优化第三方应用被kill后接收广播自启
来源:互联网 发布:唯一网络被收购 编辑:程序博客网 时间:2024/06/05 11:38
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -921,6 +924,33 @@ public final class BroadcastQueue {
// restart the application.
}
+ // app not started, do not start if thirdpart app at these intents.
+ boolean disableKeepAlive = SystemProperties.getBoolean("persist.sys.disable_keepalive", true);
+ if (disableKeepAlive) {
+ String action = r.intent.getAction();
+ ApplicationInfo appInfo = info.activityInfo.applicationInfo;
+ Slog.d(TAG, "action "+action+" app:"+appInfo);
+ if (appInfo != null && (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
+ Slog.d(TAG, "Not system app!!! [" + action + "] app=" + app );
+
+ if (action.equals("android.net.conn.CONNECTIVITY_CHANGE") ||
+ action.equals("android.intent.action.BOOT_COMPLETED") ||
+ action.equals("android.intent.action.MEDIA_MOUNTED") ||
+ action.equals("android.intent.action.MEDIA_REMOVED") ||
+ action.equals("android.intent.action.TIME_TICK") ||
+ action.equals("android.intent.action.MEDIA_UNMOUNTED") ||
+ action.equals("android.intent.action.MEDIA_BAD_REMOVAL") ||
+ action.equals("android.intent.action.MEDIA_SHARED")
+ ) {
+ logBroadcastReceiverDiscardLocked(r);
+ finishReceiverLocked(r, r.resultCode, r.resultData,
+ r.resultExtras, r.resultAbort, false);
+ scheduleBroadcastsLocked();
+ r.state = BroadcastRecord.IDLE;
+ return;
+ }
+ }
+ }
// Not running -- get it started, to be executed when the app comes up.
if (DEBUG_BROADCAST) Slog.v(TAG,
"Need to start app ["
阅读全文
0 0
- 优化第三方应用被kill后接收广播自启
- 三方应用接收不到开机广播
- android 应用停止后无法接收到广播
- Android-如何让service 不会被第三方kill
- 如何让service 不会被第三方任务管理器kill
- 如何让service 不会被第三方任务管理器kill
- 第三方测试接收标准
- Android4.4 灭屏kill第三方app
- Android4.4 灭屏kill第三方app
- android导入第三方jar后应用报NoClassDefFoundError
- 解决 framework层media自己发广播 第三方应用Permission Denial 问题
- 第三方应用市场
- 打开第三方应用
- 访问第三方应用
- 打开第三方应用
- 打开第三方应用
- 第三方应用跳转
- 接收卸载程序后的广播
- [centos] network 无法重启的几种解决方法
- SpringMvc+Mybatis多数据源切换
- zeromq源码学习——ctx创建
- 【C#】 Debug运行文件只能运行一个(不能打开多个)
- gdb---watch使用方法
- 优化第三方应用被kill后接收广播自启
- 关于Django的模板文件的路径设置templates
- PuTTY (1) Download Putty
- There is no setter for property named 可能产生的原因!
- js中alert的换行问题
- java之动态代理
- 哈希表?bmp图像处理
- Kotlin(一)
- Python学习之路