我是靠谱客的博主 要减肥信封,这篇文章主要介绍优化第三方应用被kill后接收广播自启,现在分享给大家,希望可以做个参考。

--- 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 ["



最后

以上就是要减肥信封最近收集整理的关于优化第三方应用被kill后接收广播自启的全部内容,更多相关优化第三方应用被kill后接收广播自启内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(109)

评论列表共有 0 条评论

立即
投稿
返回
顶部