Skip to content

Commit edae8c9

Browse files
committed
android cleanup
1 parent e31cd57 commit edae8c9

File tree

3 files changed

+1
-40
lines changed

3 files changed

+1
-40
lines changed

android/plugin/src/main/java/com/marianhello/bgloc/DummyActivity.java

Lines changed: 0 additions & 12 deletions
This file was deleted.

android/plugin/src/main/java/com/marianhello/bgloc/LocationService.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

plugin.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<source-file src="android/plugin/src/main/java/com/marianhello/bgloc/ActivityRecognitionLocationProvider.java" target-dir="src/com/marianhello/bgloc"/>
2929
<source-file src="android/plugin/src/main/java/com/marianhello/bgloc/BootCompletedReceiver.java" target-dir="src/com/marianhello/bgloc"/>
3030
<source-file src="android/plugin/src/main/java/com/marianhello/bgloc/Config.java" target-dir="src/com/marianhello/bgloc"/>
31-
<source-file src="android/plugin/src/main/java/com/marianhello/bgloc/DummyActivity.java" target-dir="src/com/marianhello/bgloc"/>
3231
<source-file src="android/plugin/src/main/java/com/marianhello/bgloc/HttpPostService.java" target-dir="src/com/marianhello/bgloc"/>
3332
<source-file src="android/plugin/src/main/java/com/marianhello/bgloc/LocationProvider.java" target-dir="src/com/marianhello/bgloc"/>
3433
<source-file src="android/plugin/src/main/java/com/marianhello/bgloc/LocationProviderFactory.java" target-dir="src/com/marianhello/bgloc"/>
@@ -71,18 +70,6 @@
7170

7271
<config-file target="AndroidManifest.xml" parent="/manifest/application">
7372
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
74-
<activity
75-
android:name="com.marianhello.bgloc.DummyActivity"
76-
android:theme="@android:style/Theme.NoDisplay"
77-
android:enabled="true"
78-
android:allowTaskReparenting="true"
79-
android:noHistory="true"
80-
android:excludeFromRecents="true"
81-
android:alwaysRetainTaskState="false"
82-
android:stateNotNeeded="true"
83-
android:clearTaskOnLaunch="true"
84-
android:finishOnTaskLaunch="true"
85-
/>
8673
<service
8774
android:name="com.marianhello.bgloc.sync.SyncService"
8875
android:exported="true"

0 commit comments

Comments
 (0)