Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve lifecycle, fix bugs, and general cleanup #456

Merged
merged 4 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading