Compare commits
2
Commits
262aa439db
...
124e1bc211
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
124e1bc211 | ||
|
|
1b9f40c002 |
No files matched your search
+2
-2
@@ -2,11 +2,11 @@ apply plugin: 'com.android.application'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "com.hyperling.apps.infinitetimer"
|
namespace "com.hyperling.apps.infinitetimer"
|
||||||
compileSdkVersion 36
|
compileSdkVersion 37
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.hyperling.apps.infinitetimer"
|
applicationId "com.hyperling.apps.infinitetimer"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 36
|
targetSdkVersion 37
|
||||||
versionCode 9
|
versionCode 9
|
||||||
versionName "1.1.2"
|
versionName "1.1.2"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
setLoopInterval();
|
setLoopInterval();
|
||||||
resetTimeLeft();
|
resetTimeLeft();
|
||||||
setStartTime();
|
setStartTime();
|
||||||
|
|
||||||
// Start the background alert service using Alert manager
|
// Start the background alert service using Alert manager
|
||||||
long interval = longLoopInterval > 1000 ? longLoopInterval : 60000; // Minimum 1 minute interval for alarms
|
long interval = longLoopInterval > 1000 ? longLoopInterval : 60000; // Minimum 1 minute interval for alarms
|
||||||
if (Alert.isExactAlarmAllowed(this)) {
|
if (Alert.isExactAlarmAllowed(this)) {
|
||||||
@@ -608,7 +608,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
// Safely instantiate MediaPlayer locally to prevent NPE
|
// Safely instantiate MediaPlayer locally to prevent NPE
|
||||||
Uri uri = android.media.RingtoneManager.getDefaultUri(android.media.RingtoneManager.TYPE_NOTIFICATION);
|
Uri uri = android.media.RingtoneManager.getDefaultUri(android.media.RingtoneManager.TYPE_NOTIFICATION);
|
||||||
MediaPlayer localPlayer = MediaPlayer.create(this, uri);
|
MediaPlayer localPlayer = MediaPlayer.create(this, uri);
|
||||||
|
|
||||||
if (localPlayer != null) {
|
if (localPlayer != null) {
|
||||||
localPlayer.start();
|
localPlayer.start();
|
||||||
localPlayer.release(); // Clean up resources immediately
|
localPlayer.release(); // Clean up resources immediately
|
||||||
@@ -742,7 +742,8 @@ 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..");
|
||||||
|
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
|
|||||||
@@ -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; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -13,7 +13,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:9.4.1'
|
classpath 'com.android.tools.build:gradle:9.5.0'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#Fri Jul 11 12:55:34 MST 2025
|
#Fri Jul 11 12:55:34 MST 2025
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
Reference in new issue
Block a user