Skip to content

Commit

Permalink
Merge pull request #456 from doubleangels/dev
Browse files Browse the repository at this point in the history
Improve lifecycle, fix bugs, and general cleanup
  • Loading branch information
doubleangels authored Feb 25, 2025
2 parents 63e0721 + ed92f90 commit e609c58
Show file tree
Hide file tree
Showing 13 changed files with 976 additions and 456 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "com.doubleangels.nextdnsmanagement"
minSdkVersion 32
targetSdk = 35
versionCode 259
versionName "5.5.10"
versionCode 260
versionName "5.5.11"
resourceConfigurations += ["en", "zh", "nl", "fi", "fr", "de", "in", "it", "ja", "pl", "pt", "es", "sv", "tr"]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,47 @@
import androidx.annotation.Nullable;

/**
* A basic Service class named "CustomFirebaseMessagingService."
* A simple Service implementation for Firebase Messaging.
* <p>
* This service currently does not perform any messaging functions and is set up to not restart if terminated.
* </p>
*/
public class CustomFirebaseMessagingService extends Service {

/**
* Called each time the service is started with an Intent.
* Returning START_NOT_STICKY means the system will NOT recreate the service
* if it is killed while there are no start commands pending.
* Called when the service is started.
* Returns START_NOT_STICKY so that the service is not recreated after being killed.
*
* @param intent The Intent used to start the service.
* @param flags Additional data about the start request.
* @param intent The Intent supplied to startService(Intent), as given.
* @param flags Additional data about this start request.
* @param startId A unique integer representing this specific request to start.
* @return The mode in which the system will handle if this service’s process is killed.
* @return The mode in which to continue running; START_NOT_STICKY indicates not to restart.
*/
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// Perform any necessary work here (e.g., background tasks, message handling).
// Return START_NOT_STICKY to prevent the service from restarting automatically.
return START_NOT_STICKY;
}

/**
* Called by the system when the service is first created.
* This is where you can do one-time setup before the service runs.
*/
@Override
public void onCreate() {
super.onCreate();
// Initialize resources or perform any setup needed by this service.
// Additional initialization can be done here if needed.
}

/**
* Called when another component wants to bind with the service by calling bindService().
* Returning null indicates this service is not designed to be bound; it's started as needed.
* This service does not support binding.
*
* @param intent The Intent that was used to bind to this service.
* @return An IBinder for client binding, or null if binding is not allowed.
* @return Always returns null since binding is not allowed.
*/
@Nullable
@Override
public IBinder onBind(Intent intent) {
// For a bound service, you would return a binder interface here.
// Binding is not implemented in this service.
return null;
}
}
}
Loading

0 comments on commit e609c58

Please sign in to comment.