1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 01:36:55 +00:00

Disabled suspend state monitoring

This commit is contained in:
M66B 2024-03-16 09:20:51 +01:00
parent 7b8699db34
commit 3be4ff3de8

View file

@ -234,15 +234,15 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
new IntentFilter(ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED),
ContextCompat.RECEIVER_NOT_EXPORTED);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
IntentFilter suspend = new IntentFilter();
suspend.addAction(Intent.ACTION_MY_PACKAGE_SUSPENDED);
suspend.addAction(Intent.ACTION_MY_PACKAGE_UNSUSPENDED);
ContextCompat.registerReceiver(this,
suspendChanged,
suspend,
ContextCompat.RECEIVER_NOT_EXPORTED);
}
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
// IntentFilter suspend = new IntentFilter();
// suspend.addAction(Intent.ACTION_MY_PACKAGE_SUSPENDED);
// suspend.addAction(Intent.ACTION_MY_PACKAGE_UNSUSPENDED);
// ContextCompat.registerReceiver(this,
// suspendChanged,
// suspend,
// ContextCompat.RECEIVER_NOT_EXPORTED);
//}
ContextCompat.registerReceiver(this,
batteryChanged,
@ -1036,8 +1036,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
unregisterReceiver(batteryChanged);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
unregisterReceiver(suspendChanged);
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
// unregisterReceiver(suspendChanged);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
unregisterReceiver(dataSaverChanged);