Skip to content

Commit

Permalink
Refactor App
Browse files Browse the repository at this point in the history
  • Loading branch information
zHd4 committed Jan 4, 2025
1 parent 02d9453 commit 17b6223
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/app/notesr/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static boolean onAndroid() {
return context != null;
}

public boolean serviceRunning(Class<?> serviceClass) {
public boolean isServiceRunning(Class<?> serviceClass) {
String serviceName = serviceClass.getName();
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/app/notesr/activity/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ protected void onCreate(Bundle savedInstanceState) {
intent = new Intent(this, StartActivity.class);
} else if (cryptoManager.isBlocked()) {
intent = new Intent(this, KeyRecoveryActivity.class);
} else if (App.getContext().serviceRunning(ExportService.class)) {
} else if (App.getContext().isServiceRunning(ExportService.class)) {
intent = new Intent(this, ExportActivity.class);
} else if (App.getContext().serviceRunning(ImportService.class)) {
} else if (App.getContext().isServiceRunning(ImportService.class)) {
intent = new Intent(this, ImportActivity.class);
} else if (!cryptoManager.ready()) {
intent = new Intent(this, AuthActivity.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void makeViewVisible(View view) {
}

private boolean exportRunning() {
return App.getContext().serviceRunning(ExportService.class);
return App.getContext().isServiceRunning(ExportService.class);
}

private void cancelExport() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@ private void startImport() {
}

private boolean isImportRunning() {
return App.getContext().serviceRunning(ImportService.class);
return App.getContext().isServiceRunning(ImportService.class);
}
}

0 comments on commit 17b6223

Please sign in to comment.