除了在 设置->电池优化 或者 设置-> 应用程序里 进行设置外
还可以在 adb shell 里调整
$ adb shell dumpsys deviceidle whitelist +com.mediatek.vsim Added: com.mediatek.vsim $ adb shell dumpsys deviceidle whitelist +im.softs.softsim Added: im.softs.softsim 或者 adb shell cmd deviceidle whitelist +com.mediatek.vsim adb shell cmd deviceidle whitelist +im.softs.softsim 从白名单中移除: adb shell cmd deviceidle whitelist -com.tencent.mm
查看 adb shell cmd 命令 (在Android N中添加了这个命令, 之前是没有的)
adb shell cmd -l
cactus:/ $ cmd deviceidle whitelist system-excidle,com.android.updater,9802 system-excidle,com.android.providers.downloads,10014 system-excidle,com.android.shell,2000 system-excidle,com.android.deskclock,10096 system,com.android.updater,9802 system,com.android.providers.downloads,10014 system,com.android.shell,2000 system,com.android.deskclock,10096 user,com.android.cts.priv.ctsshim,10006 user,org.simalliance.openmobileapi.uicc2terminal,10064 user,com.miui.contentextension,10030 user,com.miui.fm,10048 user,com.android.providers.calendar,10000 user,com.xiaomi.vipaccount,10052 user,com.android.providers.media,10014 user,com.milink.service,10085 user,com.mobiletools.systemhelper,10094 user,com.xiaomi.account,10075 user,com.android.wallpapercropper,10019 user,com.xiaomi.micloud.sdk,10035 user,com.miui.packageinstaller,10001 user,org.simalliance.openmobileapi.service,10051 user,com.android.documentsui,10021 user,com.android.externalstorage,10031 user,com.mediatek.vsim,10153 user,com.xiaomi.gamecenter.sdk.service,10036 user,com.android.htmlviewer,10084 user,com.miui.securityadd,10060 user,com.android.companiondevicemanager,10103 user,com.miui.gallery,10025 user,com.android.quicksearchbox,10009 user,im.softs.softsim,10152 user,com.android.providers.downloads,10014 user,com.xiaomi.payment,10100 user,com.mediatek.omacp,10080 user,com.android.browser,10033 user,com.android.soundrecorder,10004 user,com.android.defcontainer,10015 user,com.miui.guardprovider,10095 user,com.android.providers.downloads.ui,10014 user,com.android.pacprocessor,10045 user,com.miui.micloudsync,10074 user,com.xiaomi.ab,10073 user,com.android.certinstaller,10063 user,com.android.carrierconfig,10028 user,com.google.android.marvin.talkback,10076 user,com.android.contacts,10003 user,com.miui.hybrid,10065 user,com.mi.webkit.core,10023 user,com.android.mms,10032 user,com.android.mtp,10014 user,com.android.backupconfirm,10039 user,se.dirac.acs,10024 user,com.xiaomi.simactivate.service,10047 user,com.miui.player,10042 user,com.android.statementservice,10011 user,com.android.calendar,10037 user,com.miui.translation.kingsoft,10043 user,com.miui.virtualsim,10107 user,com.miui.compass,10124 user,com.miui.vpnsdkmanager,10057 user,com.android.sharedstoragebackup,10013 user,com.android.printspooler,10078 user,org.simalliance.openmobileapi.uicc1terminal,10097 user,com.miui.personalassistant,10026 user,com.android.dreams.basic,10090 user,com.android.incallui,10007 user,com.fido.xiaomi.uafclient,10059 user,com.fido.asm,10079 user,com.android.bips,10102 user,com.xiaomi.mircs,10034 user,com.miui.translation.youdao,10070 user,com.miui.cloudbackup,10040 user,com.google.android.webview,10050 user,android.ext.shared,10049 user,com.android.onetimeinitializer,10038 user,com.mipay.wallet,10061 user,com.android.camera,10041 user,com.android.printservice.recommendation,10058 user,com.xiaomi.upnp,10071 user,com.xiaomi.xmsf,10077 user,android.ext.services,10027 user,com.android.calllogbackup,10003 user,com.svox.pico,10010 user,com.android.proxyhandler,10016 user,com.miui.notes,10119 user,com.miui.video,10018 user,com.xiaomi.market,10069 user,com.miui.translationservice,10087 user,com.miui.cloudservice,10074 user,com.android.managedprovisioning,10022 user,com.miui.hybrid.accessory,10055 user,com.miui.translation.xmcloud,10099 user,com.sohu.inputmethod.sogou.xiaomi,10098 user,com.xiaomi.providers.appindex,10046 user,com.mediatek.op09clib.telecom,10067 user,com.android.smspush,10093 user,com.miui.calculator,10148 user,com.android.wallpaper.livepicker,10054 user,com.miui.miwallpaper,10081 user,com.miui.securityinputmethod,10068 user,com.xiaomi.metoknlp,10091 user,com.android.storagemanager,10008 user,com.miui.analytics,10088 user,com.miui.weather2,10147 user,com.xiaomi.scanner,10122 user,com.android.cts.ctsshim,10089 user,com.miui.yellowpage,10003 user,com.android.vpndialogs,10017 user,com.mediatek.op01.telecom,10053 user,com.android.email,10117 user,com.miui.voiceassist,10083 user,com.android.providers.blockednumber,10003 user,com.android.providers.userdictionary,10003 user,com.miui.providers.weather,10012 user,com.android.emergency,10020 user,com.miui.greenguard,10101 user,com.android.deskclock,10096 user,com.android.bluetoothmidiservice,10086 user,com.miui.smsextra,10092 user,com.mediatek.mtklogger,10072 user,com.android.thememanager.module,10044 user,com.lbe.security.miui,10005 user,com.android.providers.contacts,10003 user,com.android.captiveportallogin,10062 user,com.mediatek.mtklogger.proxy,10104 user,com.mediatek.dataprotection,10105 user,com.miui.core,10056 user,com.miui.home,10002
还有,appos允许后台运行
adb shell appops set com.mediatek.vsim RUN_IN_BACKGROUND allow 或者 adb shell cmd appops set com.mediatek.vsim RUN_IN_BACKGROUND allow adb shell cmd appops set im.softs.softsim RUN_IN_BACKGROUND allow 查询允许运行在后台 adb shell cmd appops query-op RUN_IN_BACKGROUND allow 禁止后台运行 adb shell cmd appops set com.sina.weibo RUN_IN_BACKGROUND deny adb shell cmd appops set com.tencent.mm RUN_IN_BACKGROUND deny 联想手机还有几处设置: 1.安全中心-->内存加速-->设置(右上角图标)-->加速保护名单 2.最近的应用列表:下滑加锁 3. 电池管理-->电池优化-->待机省电