华为手机上的“受保护应用”设置以及如何处理它

142

我有一部带有Android 5.0的华为P8手机,用于测试一款应用程序。该应用程序需要在后台运行,因为它要跟踪BLE区域。

我发现华为已经内置了一个名为“受保护的应用程序”的功能,可以从手机设置(电池管理器 > 受保护的应用程序)中访问。这使得特定应用程序可以在屏幕关闭后继续运行。

虽然华为考虑周到,但对我来说不太方便,因为默认情况下应用程序是未选中的,必须手动将其添加进去。虽然这不会阻碍我的测试,因为我可以在常见问题解答或打印文档中告知用户如何修复,但最近我安装了 Tinder(出于研究目的),发现它被自动添加到了受保护的应用程序列表中。

有人知道我如何为我的应用程序执行此操作吗?这是清单中的设置吗?华为是否之所以启用了Tinder,因为它是一款流行的应用程序?


@agamov,我没有找到更多关于它的信息。我只是在Play商店的描述中加了一行关于启用受保护应用程序的说明。 - jaseelder
@TejasPatel,我停止尝试解决它并只是在说明中通知用户。 - jaseelder
7个回答

79

因为Tinder是一款流行的应用,所以华为已经将其启用,但清单中没有设置,也没有一种方法可以知道应用是否受到保护。

无论如何,在onCreate()中我使用了ifHuaweiAlert()来显示一个AlertDialog

private void ifHuaweiAlert() {
    final SharedPreferences settings = getSharedPreferences("ProtectedApps", MODE_PRIVATE);
    final String saveIfSkip = "skipProtectedAppsMessage";
    boolean skipMessage = settings.getBoolean(saveIfSkip, false);
    if (!skipMessage) {
        final SharedPreferences.Editor editor = settings.edit();
        Intent intent = new Intent();
        intent.setClassName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity");
        if (isCallable(intent)) {
            final AppCompatCheckBox dontShowAgain = new AppCompatCheckBox(this);
            dontShowAgain.setText("Do not show again");
            dontShowAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                @Override
                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    editor.putBoolean(saveIfSkip, isChecked);
                    editor.apply();
                }
            });

            new AlertDialog.Builder(this)
                    .setIcon(android.R.drawable.ic_dialog_alert)
                    .setTitle("Huawei Protected Apps")
                    .setMessage(String.format("%s requires to be enabled in 'Protected Apps' to function properly.%n", getString(R.string.app_name)))
                    .setView(dontShowAgain)
                    .setPositiveButton("Protected Apps", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            huaweiProtectedApps();
                        }
                    })
                    .setNegativeButton(android.R.string.cancel, null)
                    .show();
        } else {
            editor.putBoolean(saveIfSkip, true);
            editor.apply();
        }
    }
}

private boolean isCallable(Intent intent) {
    List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent,
            PackageManager.MATCH_DEFAULT_ONLY);
    return list.size() > 0;
}

private void huaweiProtectedApps() {
    try {
        String cmd = "am start -n com.huawei.systemmanager/.optimize.process.ProtectActivity";
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            cmd += " --user " + getUserSerial();
        }
        Runtime.getRuntime().exec(cmd);
    } catch (IOException ignored) {
    }
}

private String getUserSerial() {
    //noinspection ResourceType
    Object userManager = getSystemService("user");
    if (null == userManager) return "";

    try {
        Method myUserHandleMethod = android.os.Process.class.getMethod("myUserHandle", (Class<?>[]) null);
        Object myUserHandle = myUserHandleMethod.invoke(android.os.Process.class, (Object[]) null);
        Method getSerialNumberForUser = userManager.getClass().getMethod("getSerialNumberForUser", myUserHandle.getClass());
        Long userSerial = (Long) getSerialNumberForUser.invoke(userManager, myUserHandle);
        if (userSerial != null) {
            return String.valueOf(userSerial);
        } else {
            return "";
        }
    } catch (NoSuchMethodException | IllegalArgumentException | InvocationTargetException | IllegalAccessException ignored) {
    }
    return "";
}

7
你是怎么找到类名为"com.huawei.systemmanager.optimize.process.ProtectActivity"的课程的?我想在Sony上实现类似的耐力模式,但不知道“耐力”中的包名和“除了应用程序”屏幕的类名。 - David Riha
2
如果已知包名和类名,则可以轻松使用 Intent 打开屏幕。以下是代码。 Intent intent = new Intent(); intent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")); startActivity(intent); - kinsell
1
David,你最好使用logCat。只需转到设置页面并保持logCat打开即可。 - Skynet
1
我可以为我的应用程序设置高能耗吗? - sonnv1368
5
华为P20的正确包名为:com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity。 - rsicarelli
显示剩余7条评论

44

+1给Pierre,他提供了一种适用于多个设备制造商(华为,华硕,oppo等)的优秀解决方案。

我想在我的Java Android应用程序中使用他的代码。我受到Pierre和Aiuspaktyn答案的启发。

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.support.v7.widget.AppCompatCheckBox;
import android.widget.CompoundButton;
import java.util.List;

public class Utils {

public static void startPowerSaverIntent(Context context) {
    SharedPreferences settings = context.getSharedPreferences("ProtectedApps", Context.MODE_PRIVATE);
    boolean skipMessage = settings.getBoolean("skipProtectedAppCheck", false);
    if (!skipMessage) {
        final SharedPreferences.Editor editor = settings.edit();
        boolean foundCorrectIntent = false;
        for (Intent intent : Constants.POWERMANAGER_INTENTS) {
            if (isCallable(context, intent)) {
                foundCorrectIntent = true;
                final AppCompatCheckBox dontShowAgain = new AppCompatCheckBox(context);
                dontShowAgain.setText("Do not show again");
                dontShowAgain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
                    @Override
                    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                        editor.putBoolean("skipProtectedAppCheck", isChecked);
                        editor.apply();
                    }
                });

                new AlertDialog.Builder(context)
                        .setTitle(Build.MANUFACTURER + " Protected Apps")
                        .setMessage(String.format("%s requires to be enabled in 'Protected Apps' to function properly.%n", context.getString(R.string.app_name)))
                        .setView(dontShowAgain)
                        .setPositiveButton("Go to settings", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                                context.startActivity(intent);
                            }
                        })
                        .setNegativeButton(android.R.string.cancel, null)
                        .show();
                break;
            }
        }
        if (!foundCorrectIntent) {
            editor.putBoolean("skipProtectedAppCheck", true);
            editor.apply();
        }
    }
}

private static boolean isCallable(Context context, Intent intent) {
    try {
        if (intent == null || context == null) {
            return false;
        } else {
            List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent,
                    PackageManager.MATCH_DEFAULT_ONLY);
            return list.size() > 0;
        }
    } catch (Exception ignored) {
        return false;
    }
}
}

}

import android.content.ComponentName;
import android.content.Intent;
import java.util.Arrays;
import java.util.List;

public class Constants {
//updated the POWERMANAGER_INTENTS 26/06/2019
static final List<Intent> POWERMANAGER_INTENTS = Arrays.asList(
        new Intent().setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity")),
        new Intent().setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity")),
        new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")),
        new Intent().setComponent(new ComponentName("com.huawei.systemmanager", Build.VERSION.SDK_INT >= Build.VERSION_CODES.P? "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity": "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")),
        new Intent().setComponent(new ComponentName("com.coloros.oppoguardelf", "com.coloros.powermanager.fuelgaue.PowerUsageModelActivity")),
        new Intent().setComponent(new ComponentName("com.coloros.oppoguardelf", "com.coloros.powermanager.fuelgaue.PowerSaverModeActivity")),
        new Intent().setComponent(new ComponentName("com.coloros.oppoguardelf", "com.coloros.powermanager.fuelgaue.PowerConsumptionActivity")),
        new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity")),
        Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.StartupAppListActivity")).setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).setData(Uri.parse("package:"+ MyApplication.getContext().getPackageName())) : null,
        new Intent().setComponent(new ComponentName("com.oppo.safe", "com.oppo.safe.permission.startup.StartupAppListActivity")),
        new Intent().setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.AddWhiteListActivity")),
        new Intent().setComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.BgStartUpManager")),
        new Intent().setComponent(new ComponentName("com.vivo.permissionmanager", "com.vivo.permissionmanager.activity.BgStartUpManagerActivity")),
        new Intent().setComponent(new ComponentName("com.asus.mobilemanager", "com.asus.mobilemanager.entry.FunctionActivity")),
        new Intent().setComponent(new ComponentName("com.asus.mobilemanager", "com.asus.mobilemanager.autostart.AutoStartActivity")),
        new Intent().setComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity"))
                .setData(android.net.Uri.parse("mobilemanager://function/entry/AutoStart")),
        new Intent().setComponent(new ComponentName("com.meizu.safe", "com.meizu.safe.security.SHOW_APPSEC")).addCategory(Intent.CATEGORY_DEFAULT).putExtra("packageName", BuildConfig.APPLICATION_ID)
);
}
在你的 Android.Manifest 中添加以下权限。
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="oppo.permission.OPPO_COMPONENT_SAFE"/>
<uses-permission android:name="com.huawei.permission.external_app_settings.USE_COMPONENT"/>
  • 我仍然在使用OPPO设备时遇到了一些问题

我希望这能对某些人有所帮助。


3
表现良好。现在,华为似乎不再使用ProtectedApp设置。看起来它正在使用一个名为“启动-管理应用程序启动和后台运行以节省电量”的选项,在这个选项中,您需要允许应用程序“自动启动”,“二次启动”和“后台运行”。您知道这是什么意图吗? - Ton
5
请使用此命令:com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity。 - Simon
2
将Asus更改为ComponentName(“com.asus.mobilemanager”,“com.asus.mobilemanager.autostart.AutoStartActivity”) - Cristian Cardoso
4
更改华为手机 EMUI 版本号高于 +5 的设置:new Intent().setComponent(new ComponentName("com.huawei.systemmanager", Build.VERSION.SDK_INT >= Build.VERSION_CODES.P? "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity": "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")), - Alex Cuadrón
1
阅读此内容:https://dev59.com/jlcP5IYBdhLWcg3wHmtU <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/> 可能会导致您被禁止。 - beginner
显示剩余4条评论

37
if("huawei".equalsIgnoreCase(android.os.Build.MANUFACTURER) && !sp.getBoolean("protected",false)) {
        AlertDialog.Builder builder  = new AlertDialog.Builder(this);
        builder.setTitle(R.string.huawei_headline).setMessage(R.string.huawei_text)
                .setPositiveButton(R.string.go_to_protected, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        Intent intent = new Intent();
                        intent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity"));
                        startActivity(intent);
                        sp.edit().putBoolean("protected",true).commit();
                    }
                }).create().show();
    }

1
在能够知道应用程序是否受到保护之前,这是最好的方法,但为了避免每次都显示它,我有一个“不再显示”选项,消息是“如果您不进行保护,可能会收取更多费用”,操作是“忽略,我要冒险”或“前往设置”。 - Saik Caskey
1
ASUS自启动管理器有类似的东西吗? - Alessandro Scarozza
3
是的,@Xan。只需按以下方式创建组件名称: ComponentName("com.asus.mobilemanager","com.asus.mobilemanager.autostart.AutoStartActivity"); - Michel Fortes
4
请问 "sp" 对象从哪里来?在这里被用于什么?sp.edit().putBoolean("protected",true).commit(); 我理解你是将值更改为"protected",对吗? - Leonardo G.
2
@LeonardoG.:我非常确定"sp"代表SharedPreferences,最终代码为:final SharedPreferences sp = getSharedPreferences("ProtectedApps", Context.MODE_PRIVATE); - papesky

21

适用于所有设备的解决方案 (Xamarin.Android)

用法:

MainActivity =>
protected override void OnCreate(Bundle savedInstanceState)
{
    base.OnCreate(savedInstanceState);

    MyUtils.StartPowerSaverIntent(this);
}

public class MyUtils
{
    private const string SKIP_INTENT_CHECK = "skipAppListMessage";

    private static List<Intent> POWERMANAGER_INTENTS = new List<Intent>()
    {
        new Intent().SetComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity")),
        new Intent().SetComponent(new ComponentName("com.letv.android.letvsafe", "com.letv.android.letvsafe.AutobootManageActivity")),
        new Intent().SetComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")),
        new Intent().SetComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")),
        new Intent().SetComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity")),
        new Intent().SetComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.StartupAppListActivity")),
        new Intent().SetComponent(new ComponentName("com.oppo.safe", "com.oppo.safe.permission.startup.StartupAppListActivity")),
        new Intent().SetComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.AddWhiteListActivity")),
        new Intent().SetComponent(new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.BgStartUpManager")),
        new Intent().SetComponent(new ComponentName("com.vivo.permissionmanager", "com.vivo.permissionmanager.activity.BgStartUpManagerActivity")),
        new Intent().SetComponent(new ComponentName("com.samsung.android.lool", "com.samsung.android.sm.ui.battery.BatteryActivity")),
        new Intent().SetComponent(new ComponentName("com.htc.pitroad", "com.htc.pitroad.landingpage.activity.LandingPageActivity")),
        new Intent().SetComponent(new ComponentName("com.asus.mobilemanager", "com.asus.mobilemanager.autostart.AutoStartActivity")),
        new Intent().SetComponent(new ComponentName("com.asus.mobilemanager", "com.asus.mobilemanager.entry.FunctionActivity")).SetData(Android.Net.Uri.Parse("mobilemanager://function/entry/AutoStart")),
        new Intent().SetComponent(new ComponentName("com.dewav.dwappmanager", "com.dewav.dwappmanager.memory.SmartClearupWhiteList"))
    };

    public static void StartPowerSaverIntent(Context context)
    {
        ISharedPreferences settings = context.GetSharedPreferences("ProtectedApps", FileCreationMode.Private);
        bool skipMessage = settings.GetBoolean(SKIP_INTENT_CHECK, false);
        if (!skipMessage)
        {
            bool HasIntent = false;
            ISharedPreferencesEditor editor = settings.Edit();
            foreach (Intent intent in POWERMANAGER_INTENTS)
            {
                if (context.PackageManager.ResolveActivity(intent, PackageInfoFlags.MatchDefaultOnly) != null)
                {
                    var dontShowAgain = new Android.Support.V7.Widget.AppCompatCheckBox(context);
                    dontShowAgain.Text = "Do not show again";
                    dontShowAgain.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) =>
                    {
                        editor.PutBoolean(SKIP_INTENT_CHECK, e.IsChecked);
                        editor.Apply();
                    };

                    new AlertDialog.Builder(context)
                    .SetIcon(Android.Resource.Drawable.IcDialogAlert)
                    .SetTitle(string.Format("Add {0} to list", context.GetString(Resource.String.app_name)))
                    .SetMessage(string.Format("{0} requires to be enabled/added in the list to function properly.\n", context.GetString(Resource.String.app_name)))
                    .SetView(dontShowAgain)
                    .SetPositiveButton("Go to settings", (o, d) => context.StartActivity(intent))
                    .SetNegativeButton(Android.Resource.String.Cancel, (o, d) => { })
                    .Show();

                    HasIntent = true;

                    break;
                }
            }

            if (!HasIntent)
            {
                editor.PutBoolean(SKIP_INTENT_CHECK, true);
                editor.Apply();
            }
        }
    }
}
在您的Android.Manifest中添加以下权限。
<uses-permission android:name="oppo.permission.OPPO_COMPONENT_SAFE"/>
<uses-permission android:name="com.huawei.permission.external_app_settings.USE_COMPONENT"/>

为了帮助找到这里未列出的设备的活动,只需使用以下方法来帮助找到正确的活动以供用户打开。

C#

public static void LogDeviceBrandActivities(Context context)
{
    var Brand = Android.OS.Build.Brand?.ToLower()?.Trim() ?? "";
    var Manufacturer = Android.OS.Build.Manufacturer?.ToLower()?.Trim() ?? "";

    var apps = context.PackageManager.GetInstalledPackages(PackageInfoFlags.Activities);

    foreach (PackageInfo pi in apps.OrderBy(n => n.PackageName))
    {
        if (pi.PackageName.ToLower().Contains(Brand) || pi.PackageName.ToLower().Contains(Manufacturer))
        {
            var print = false;
            var activityInfo = "";

            if (pi.Activities != null)
            {
                foreach (var activity in pi.Activities.OrderBy(n => n.Name))
                {
                    if (activity.Name.ToLower().Contains(Brand) || activity.Name.ToLower().Contains(Manufacturer))
                    {
                        activityInfo += "  Activity: " + activity.Name + (string.IsNullOrEmpty(activity.Permission) ? "" : " - Permission: " + activity.Permission) + "\n";
                        print = true;
                    }
                }
            }

            if (print)
            {
                Android.Util.Log.Error("brand.activities", "PackageName: " + pi.PackageName);
                Android.Util.Log.Warn("brand.activities", activityInfo);
            }
        }
    }
}

Java

public static void logDeviceBrandActivities(Context context) {
    String brand = Build.BRAND.toLowerCase();
    String manufacturer = Build.MANUFACTURER.toLowerCase();

    List<PackageInfo> apps = context.getPackageManager().getInstalledPackages(PackageManager.GET_ACTIVITIES);

    Collections.sort(apps, (a, b) -> a.packageName.compareTo(b.packageName));
    for (PackageInfo pi : apps) {
        if (pi.packageName.toLowerCase().contains(brand) || pi.packageName.toLowerCase().contains(manufacturer)) {
            boolean print = false;
            StringBuilder activityInfo = new StringBuilder();

            if (pi.activities != null && pi.activities.length > 0) {
                List<ActivityInfo> activities = Arrays.asList(pi.activities);

                Collections.sort(activities, (a, b) -> a.name.compareTo(b.name));
                for (ActivityInfo ai : activities) {
                    if (ai.name.toLowerCase().contains(brand) || ai.name.toLowerCase().contains(manufacturer)) {
                        activityInfo.append("  Activity: ").append(ai.name)
                                .append(ai.permission == null || ai.permission.length() == 0 ? "" : " - Permission: " + ai.permission)
                                .append("\n");
                        print = true;
                    }
                }
            }

            if (print) {
                Log.e("brand.activities", "PackageName: " + pi.packageName);
                Log.w("brand.activities", activityInfo.toString());
            }
        }
    }
}

开机后执行并搜索日志文件,在brand.activitiesTAG上添加一个logcat过滤器。

MainActivity =>
protected override void OnCreate(Bundle savedInstanceState)
{
    base.OnCreate(savedInstanceState);

    MyUtils.LogDeviceBrandActivities(this);
}

示例输出:

E/brand.activities: PackageName: com.samsung.android.lool
W/brand.activities: ...
W/brand.activities:   Activity: com.samsung.android.sm.ui.battery.AppSleepSettingActivity
W/brand.activities:   Activity: com.samsung.android.sm.ui.battery.BatteryActivity <-- This is the one...
W/brand.activities:   Activity: com.samsung.android.sm.ui.battery.BatteryActivityForCard
W/brand.activities: ...

因此,组件名称将是:

new ComponentName("<PackageName>", "<Activity>")
new ComponentName("com.samsung.android.lool", "com.samsung.android.sm.ui.battery.BatteryActivity")

如果活动旁边有一个权限,则需要在Android.Manifest中添加以下条目才能打开该活动:

<uses-permission android:name="<permission>" />

请评论或编辑新组件到此回答中。非常感谢您的所有帮助。


你是怎么找到类名为“com.huawei.systemmanager.optimize.process.ProtectActivity”的?我想为Qmobile实现类似的功能,但不知道Qmobile的包名和“except apps”屏幕的类名。 - Noaman Akram
1
你可以在回答中编辑关于Qmobile的内容.. new Intent().setComponent(new ComponentName( "com.dewav.dwappmanager", "com.dewav.dwappmanager.memory.SmartClearupWhiteList")), - Noaman Akram
我已经使用了这段代码,但是在三星J6手机上无法运行。 - Farmer
@Pierre,你有没有考虑把这个项目做成一个GitHub库,以便其他项目可以直接包含它?其他开发者也可以通过拉取请求贡献新的组件。你有什么想法? - Shankari

2
你可以使用这个库来引导用户进入受保护的应用或自启动应用程序: AutoStarter 如果手机支持自启动功能,你可以向用户展示一个提示,让他们在这些应用中启用你的应用。
你可以通过以下方法进行检查:
AutoStartPermissionHelper.getInstance().isAutoStartPermissionAvailable(context)

要将用户导航到该页面,只需调用以下代码:

AutoStartPermissionHelper.getInstance().getAutoStartPermission(context)

针对华为Mate 20 Pro出现以下崩溃:android.os.RemoteException: Remote stack trace: at com.android.server.wm.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1194) at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:904) at com.android.server.wm.ActivityStarter.startActivity(ActivityStarter.java:652) at com.android.server.wm.HwActivityStarter.startActivity(HwActivityStarter.java:292) at com.android.server.wm.ActivityStarter.startActivityMayWait(ActivityStarter.java:1647) - Hiren Patel

0

我正在使用@Aiuspaktyn的解决方案,但缺少如何检测用户将应用程序设置为受保护后停止显示对话框的部分。我使用一个服务来检查应用程序是否已终止,检查其是否存在。


3
当然可以,请问您能否提供您所需要翻译的具体内容呢? - Zaki

-6

PowerMaster -> AutoStart -> 在被阻止的部分找到您的应用程序并允许


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接