日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

android:persistent (非系统app失效)

發布時間:2024/4/15 windows 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android:persistent (非系统app失效) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

非系統app設置persistent無效

安裝時 if ((flags&PARSE_IS_SYSTEM) != 0) {if (sa.getBoolean(com.android.internal.R.styleable.AndroidManifestApplication_persistent,false)) {ai.flags |= ApplicationInfo.FLAG_PERSISTENT;}}



系統啟動時會拉起persistent的(系統)app

try {List apps = AppGlobals.getPackageManager().getPersistentApplications(STOCK_PM_FLAGS);if (apps != null) {int N = apps.size();int i;for (i=0; i<N; i++) {ApplicationInfo info= (ApplicationInfo)apps.get(i);if (info != null &&!info.packageName.equals("android")) {addAppLocked(info, false, null /* ABI override */);}}} } catch (RemoteException ex) {// pm is in same process, this will never happen. }final ProcessRecord addAppLocked(ApplicationInfo info, boolean isolated,String abiOverride) {if (app.thread == null && mPersistentStartingProcesses.indexOf(app) < 0) {mPersistentStartingProcesses.add(app);startProcessLocked(app, "added application", app.processName, abiOverride,null /* entryPoint */, null /* entryPointArgs */);}return app;}



app進程死掉之后重啟persistent app

private final boolean cleanUpApplicationRecordLocked(ProcessRecord app,boolean restarting, boolean allowRestart, int index) {if (!app.persistent || app.isolated) {} else if (!app.removed) {// This app is persistent, so we need to keep its record around.// If it is not already on the pending app list, add it there// and start a new process for it.if (mPersistentStartingProcesses.indexOf(app) < 0) {mPersistentStartingProcesses.add(app);restart = true;}}if (restart && !app.isolated) {// We have components that still need to be running in the// process, so re-launch it.if (index < 0) {ProcessList.remove(app.pid);}addProcessNameLocked(app);startProcessLocked(app, "restart", app.processName);return true;} else if (app.pid > 0 && app.pid != MY_PID) {}return false; }



非系統app標志位失效

if ((flags&PARSE_IS_SYSTEM) != 0) {if (sa.getBoolean(com.android.internal.R.styleable.AndroidManifestApplication_persistent,false)) {ai.flags |= ApplicationInfo.FLAG_PERSISTENT;} }

總結

以上是生活随笔為你收集整理的android:persistent (非系统app失效)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。