admin管理员组文章数量:1532656
2023年12月26日发(作者:)
@@ -86,6 +115,8 @@ public class SystemUIApplication extends Application { // application theme in the manifest does only work for activities. Keep this in sync with // the theme set there. setTheme(ui_theme);+
+ mContext = getApplicationContext(); FromConfig(this);@@ -143,6 +174,7 @@ public class SystemUIApplication extends Application { private static final String SETTING_SYSTEM = ""; private static final String SETTING_SECURE = ""; private static final String SETTING_GLOBAL = "";+ private static final String BROADCAST_SCREENSHOT = ""; private String valueContent = "0"; private MainReceiver mainReceiver;
@@ -150,6 +182,10 @@ public class SystemUIApplication extends Application { .i("AZ", log); }
+ private void LDLog(String log) {+ .i("LD", log);+ }+
public class MainReceiver extends BroadcastReceiver { @Override@@ -225,6 +261,18 @@ public class SystemUIApplication extends Application { ra("_CONFIRM", false); gs(_ACTIVITY_NEW_TASK); ctivity(intentDown);+ } else if (BROADCAST_(action)) {+ Intent intentScreenShot = new Intent("SHOT");+ ra("path", ras().getString("path"));+ ra("name", ras().getString("name"));+ oadcast(intentScreenShot);+ } else if (BROADCAST_(action)) {+ //checkLaidianAppAlive();+ try{+ Callbacks(laidianAppR);+ }catch(Exception e){+ }+ layed(laidianAppR, 1000); } } }@@ -326,4 +374,82 @@ public class SystemUIApplication extends Application { public SystemUI[] getServices() { return mServices; }+
+
+ Handler mHandler = new Handler();+ private int laidianAppCheckTime = 3000;+ Runnable laidianAppR = new Runnable(){++ @Override+ public void run() {+ checkAppAlive(pkgName", "clsName");+ layed(laidianAppR, laidianAppCheckTime);+ }+
+ };++ private void checkAppAlive(String pkgName, String clsName){+ long startTime = tTimeMillis();+ if(!isAppAlive(pkgName)){+ LDLog(" to ");+ try{+ ComponentName componentName = new ComponentName(pkgName, clsName);+ Intent intent = new Intent();+ ponent(componentName);+ gs(_ACTIVITY_NEW_TASK);+ ctivity(intent);+ }catch(Exception e){+
+ }+ }else{
版权声明:本文标题:Android普通应用升级为系统应用并获取系统权限的操作 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1703535597a59594.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论