复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63/** * Created by carmelo on 2018/3/17. * 国内手机厂商白名单跳转工具类 */ public class SettingUtils { public static void enterWhiteListSetting(Context context){ try { context.startActivity(getSettingIntent()); }catch (Exception e){ context.startActivity(new Intent(Settings.ACTION_SETTINGS)); } } private static Intent getSettingIntent(){ ComponentName componentName = null; String brand = android.os.Build.BRAND; Log.e("SettingUtils","brand="+brand); switch (brand.toLowerCase()){ case "samsung": componentName = new ComponentName("com.samsung.android.sm", "com.samsung.android.sm.app.dashboard.SmartManagerDashBoardActivity"); break; case "honor": case "huawei": componentName = new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.startupmgr.ui.StartupNormalAppListActivity"); break; case "xiaomi": componentName = new ComponentName("com.miui.securitycenter", "com.miui.permcenter.autostart.AutoStartManagementActivity"); break; case "vivo": componentName = new ComponentName("com.iqoo.secure", "com.iqoo.secure.ui.phoneoptimize.AddWhiteListActivity"); break; case "oppo": componentName = new ComponentName("com.coloros.oppoguardelf", "com.coloros.powermanager.fuelgaue.PowerUsageModelActivity"); break; case "360": componentName = new ComponentName("com.yulong.android.coolsafe", "com.yulong.android.coolsafe.ui.activity.autorun.AutoRunListActivity"); break; case "meizu": componentName = new ComponentName("com.meizu.safe", "com.meizu.safe.permission.SmartBGActivity"); break; case "oneplus": componentName = new ComponentName("com.oneplus.security", "com.oneplus.security.chainlaunch.view.ChainLaunchAppListActivity"); break; default: break; } Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if(componentName!=null){ intent.setComponent(componentName); }else{ intent.setAction(Settings.ACTION_SETTINGS); } return intent; } }
最后
以上就是魔幻西装最近收集整理的关于白名单设置的全部内容,更多相关白名单设置内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复