mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Include background restriction status in the logs.
This commit is contained in:
committed by
Cody Henthorne
parent
42c3cc5296
commit
c25250cb05
@@ -6,6 +6,7 @@ import android.content.Context;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
/**
|
||||
* Easy access to various properties of the device, typically to make performance-related decisions.
|
||||
@@ -48,4 +49,10 @@ public final class DeviceProperties {
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@RequiresApi(28)
|
||||
public static boolean isBackgroundRestricted(@NonNull Context context) {
|
||||
ActivityManager activityManager = ServiceUtil.getActivityManager(context);
|
||||
return activityManager.isBackgroundRestricted();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user