Debug info: MIUI autostart

This commit is contained in:
M66B
2023-08-29 21:08:41 +02:00
parent 0034267565
commit 20e5acdc95
2 changed files with 16 additions and 1 deletions

View File

@@ -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);