Fix some of the agent's code, mediaplayer not defined in TimerForegroundService so maybe it was intended for Main, and PowerManager's WakeLock tag wanted to know the app name with a colon for logging.
This commit is contained in:
1 parent
1b9f40c002
commit
124e1bc211
2 files changed
+2
-2
No files matched your search
@@ -742,6 +742,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
// Stop the background alert service when destroying activity
|
// Stop the background alert service when destroying activity
|
||||||
Alert.stop(this);
|
Alert.stop(this);
|
||||||
|
if (mediaPlayer != null) { mediaPlayer.release(); mediaPlayer = null; }
|
||||||
|
|
||||||
if (DEBUG) Log.d(tag, "Done with local code, calling super..");
|
if (DEBUG) Log.d(tag, "Done with local code, calling super..");
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class TimerForegroundService extends Service {
|
|||||||
|
|
||||||
// Acquire a wake lock briefly to ensure the CPU stays awake during playback
|
// Acquire a wake lock briefly to ensure the CPU stays awake during playback
|
||||||
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
|
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
|
||||||
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "TimerWakeLock");
|
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "InfiniteTimer:TimerWakeLock");
|
||||||
wakeLock.acquire(60 * 1000L);
|
wakeLock.acquire(60 * 1000L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +91,5 @@ public class TimerForegroundService extends Service {
|
|||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
if (wakeLock.isHeld()) wakeLock.release();
|
if (wakeLock.isHeld()) wakeLock.release();
|
||||||
if (mediaPlayer != null) { mediaPlayer.release(); mediaPlayer = null; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user