如何启动所有Android制造商的电源管理器以启用后台和推送通知? [英] How to start Power Manager of all android manufactures to enable background and push notification?

查看:1271
本文介绍了如何启动所有Android制造商的电源管理器以启用后台和推送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些由于自定义Android调整而导致的Android设备是由制造商完成的,其中一些关于电源管理的政策会破坏一些功能,例如推送通知.

Some Android devices due to custom Android tweaks are done by manufacturers has some politics about Power Management that breaks some features like push notifications.

  • 华为-仅适用于EMUI 5.0之前的版本/Android 7-转到设置">受保护的应用程序",检查您的应用程序.
  • 索尼-点击电池图标.进入电源管理> STAMINA模式>在待机状态下处于活动状态的应用程序>添加您的应用程序.
  • 华硕-在自动启动管理器中检查您的应用.
  • 小米-安全性(应用程序)>权限>自动启动-启用您的应用程序
  • *新小米-设置>开发人员选项.禁用内存优化".要启用开发人员选项",请转到设置">关于".点按MIUI 8次.
  • Oppo-转到设置">安全设置">数据保存",然后启用您的应用.
  • 三星-禁用电池使用优化

我想收集启动各自工具的意图,但我只发现了针对华为和小米的东西.

I want to collect intents to launch respective tools, but I have found only for Huawei and Xiaomi.

Intent INTENT_HUAWEI = new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity"));
Intent INTENT_XIAOMI = new Intent().setComponent(new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"));

if (getPackageManager().resolveActivity(INTENT_HUAWEI, PackageManager.MATCH_DEFAULT_ONLY) != null)
    startActivity(INTENT_HUAWEI);
else if (getPackageManager().resolveActivity(INTENT_XIAOMI, PackageManager.MATCH_DEFAULT_ONLY) != null)
    startActivity(INTENT_XIAOMI);

我需要其他所有制片人的帮助,

I need help from all other producers, thz

推荐答案

我从各种帖子中收集了一些意图:

i have collected some intent from various post:

    private static final Intent[] POWERMANAGER_INTENTS = {
            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.startupmgr.ui.StartupNormalAppListActivity")),
            new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity")),
            new Intent().setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.appcontrol.activity.StartupAppControlActivity")),
            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.MainActivity")),
            new Intent().setComponent(new ComponentName("com.transsion.phonemanager", "com.itel.autobootmanager.activity.AutoBootMgrActivity"))
    };

            for (Intent intent : POWERMANAGER_INTENTS)
                if (getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
                    // show dialog to ask user action
                    break;
                }

在用户同意后

for (Intent intent : POWERMANAGER_INTENTS)
  if (getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
  startActivity(intent);
  break;
}

接缝新版本需要此权限

<uses-permission android:name="oppo.permission.OPPO_COMPONENT_SAFE"/>
<uses-permission android:name="com.huawei.permission.external_app_settings.USE_COMPONENT"/>

我想收集所有打开电源管理器的意图,如果有人发现错误或想要改进某些地方,请在此处评论

i want to collect all intent to open power manager, if anyone found mistake or want to improve something, comment here

这篇关于如何启动所有Android制造商的电源管理器以启用后台和推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆