rename to FDroidApp.restartLocalRepoServiceIfRunning() for clarity
This method handles checking if the service is running, and only restarts it if it was running.
This commit is contained in:
parent
c1b0b854fc
commit
6703fa3652
@ -337,7 +337,10 @@ public class FDroidApp extends Application {
|
|||||||
app.stopService(new Intent(app, LocalRepoService.class));
|
app.stopService(new Intent(app, LocalRepoService.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void restartLocalRepoService() {
|
/**
|
||||||
|
* Handles checking if the {@link LocalRepoService} is running, and only restarts it if it was running.
|
||||||
|
*/
|
||||||
|
public static void restartLocalRepoServiceIfRunning() {
|
||||||
if (localRepoServiceMessenger != null) {
|
if (localRepoServiceMessenger != null) {
|
||||||
try {
|
try {
|
||||||
Message msg = Message.obtain(null, LocalRepoService.RESTART, LocalRepoService.RESTART, 0);
|
Message msg = Message.obtain(null, LocalRepoService.RESTART, LocalRepoService.RESTART, 0);
|
||||||
|
@ -127,7 +127,7 @@ public class WifiStateChangeService extends Service {
|
|||||||
Intent intent = new Intent(BROADCAST);
|
Intent intent = new Intent(BROADCAST);
|
||||||
LocalBroadcastManager.getInstance(WifiStateChangeService.this).sendBroadcast(intent);
|
LocalBroadcastManager.getInstance(WifiStateChangeService.this).sendBroadcast(intent);
|
||||||
WifiStateChangeService.this.stopSelf();
|
WifiStateChangeService.this.stopSelf();
|
||||||
FDroidApp.restartLocalRepoService();
|
FDroidApp.restartLocalRepoServiceIfRunning();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user