@@ -187,7 +187,6 @@ public void onCreate() {
187187 public void onDestroy () {
188188 log .info ("Destroying LocationService" );
189189 provider .onDestroy ();
190- // stopForeground(true);
191190 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .JELLY_BEAN_MR2 ) {
192191 handlerThread .quitSafely ();
193192 } else {
@@ -197,7 +196,6 @@ public void onDestroy() {
197196 super .onDestroy ();
198197 }
199198
200- // @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
201199 @ Override
202200 public void onTaskRemoved (Intent rootIntent ) {
203201 log .debug ("Task has been removed" );
@@ -206,9 +204,6 @@ public void onTaskRemoved(Intent rootIntent) {
206204 stopSelf ();
207205 } else {
208206 log .info ("Continue running in background" );
209- // Intent intent = new Intent( this, DummyActivity.class );
210- // intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
211- // startActivity(intent);
212207 }
213208 super .onTaskRemoved (rootIntent );
214209 }
@@ -333,7 +328,7 @@ public void handleLocation(BackgroundLocation location) {
333328 log .debug ("New location {}" , location .toString ());
334329
335330 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .JELLY_BEAN_MR1 ) {
336- // we do check only of API level >= 17 because in lower version it does more harm then good
331+ // we do check only of API level >= 17 because in lower version it does more harm than good
337332 if (location .isBetterLocationThan (lastLocation ) == false ) {
338333 log .debug ("Previous location: [{} acc={} t={}] is better than current" ,
339334 lastLocation .getProvider (), lastLocation .getAccuracy (), lastLocation .getTime ());
@@ -443,15 +438,6 @@ public void postLocationAsync(BackgroundLocation location) {
443438 }
444439 }
445440
446- /**
447- * Forces the main activity to re-launch if it's unloaded.
448- */
449- private void forceMainActivityReload () {
450- PackageManager pm = getPackageManager ();
451- Intent launchIntent = pm .getLaunchIntentForPackage (getApplicationContext ().getPackageName ());
452- startActivity (launchIntent );
453- }
454-
455441 public Config getConfig () {
456442 return this .config ;
457443 }
0 commit comments