This commit is contained in:
M66B 2024-01-30 14:37:31 +01:00
parent bad858b7dc
commit 359e0fa73a
2 changed files with 1 additions and 18 deletions

View File

@ -271,10 +271,7 @@ public class DebugHelper {
Build.VERSION.RELEASE, Build.VERSION.SDK_INT, Helper.getTargetSdk(context)));
String miui = Helper.getMIUIVersion();
Integer autostart = (miui == null ? null : Helper.getMIUIAutostart(context));
sb.append(String.format("MIUI: %s autostart: %s\r\n",
miui == null ? "-" : miui,
autostart == null ? "?" : Boolean.toString(autostart == 0)));
sb.append(String.format("MIUI: %s\r\n", miui == null ? "-" : miui));
boolean reporting = prefs.getBoolean("crash_reports", false);
if (reporting || Log.isTestRelease()) {

View File

@ -1687,20 +1687,6 @@ public class Helper {
}
}
// 0=allowed, 1=denied
static Integer getMIUIAutostart(Context context) {
try {
@SuppressLint("PrivateApi")
Class<?> c = Class.forName("android.miui.AppOpsUtils");
Method m = c.getDeclaredMethod("getApplicationAutoStart", Context.class, String.class);
m.setAccessible(true);
return (Integer) m.invoke(null, context, context.getPackageName());
} catch (Throwable ex) {
Log.w(ex);
return null;
}
}
static String getUiModeType(Context context) {
try {
UiModeManager uimm = Helper.getSystemService(context, UiModeManager.class);