mirror of https://github.com/M66B/FairEmail.git
Debug info: MIUI autostart
This commit is contained in:
parent
0034267565
commit
20e5acdc95
|
@ -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);
|
||||
|
|
|
@ -2005,7 +2005,9 @@ public class Log {
|
|||
Build.VERSION.RELEASE, Build.VERSION.SDK_INT, Helper.getTargetSdk(context)));
|
||||
|
||||
String miui = Helper.getMIUIVersion();
|
||||
sb.append(String.format("MIUI: %s\r\n", miui == null ? "-" : miui));
|
||||
boolean autostart = (miui != null && Helper.getMIUIAutostart(context));
|
||||
sb.append(String.format("MIUI: %s autostart=%b\r\n",
|
||||
miui == null ? "-" : miui, autostart));
|
||||
|
||||
boolean reporting = prefs.getBoolean("crash_reports", false);
|
||||
if (reporting || BuildConfig.TEST_RELEASE) {
|
||||
|
|
Loading…
Reference in New Issue