mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 09:03:56 +02:00
Debug info: MIUI autostart
This commit is contained in:
@@ -1595,6 +1595,19 @@ public class Helper {
|
||||
}
|
||||
}
|
||||
|
||||
static Boolean getMIUIAutostart(Context context) {
|
||||
try {
|
||||
Class<?> c = Class.forName("android.miui.AppOpsUtils");
|
||||
Method m = c.getDeclaredMethod("getApplicationAutoStart", Context.class, String.class);
|
||||
m.setAccessible(true);
|
||||
Integer result = (Integer) m.invoke(null, context, context.getPackageName());
|
||||
return (result != null && result.equals(0));
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static String getUiModeType(Context context) {
|
||||
try {
|
||||
UiModeManager uimm = Helper.getSystemService(context, UiModeManager.class);
|
||||
|
||||
Reference in New Issue
Block a user