Android app黑白名单

Android app黑白名单

Android设备系统正常工作时,很多Service运行在后台,只用在系统内存不够使用时候,,才会自动kill掉后台Service Android OTT盒子项目开发中,网络机顶盒运行内存512M/1G 内存不够使用,为了提高系统的流畅性,编译固件时加入app黑白名单功能。

Android系统开机后会发出BroadcastReceiver开机广播, 在设置app 添加BootCompletedReceiverAML.java

{String TAG = “BootCompletedReceiverAML”;(Context context, Intent intent) {initScreenSaver();initEnableRunningBackgroudComponents();initEnableAutoRunningComponents();initLauncherComponents();}() {Settings.System.putInt(mContext.getContentResolver(),Settings.System.BOOT_GUIDE_COMPLETED, 1);IDreamManager mDreamManager = IDreamManager.Stub.asInterface(ServiceManager.getService(DreamService.DREAM_SERVICE));ComponentName dream = newComponentName(“com.mipt.screensaver”,”com.mipt.screensaver.ScreenSaverService”);try {ComponentName[] dreams = { dream };mDreamManager.setDreamComponents(dream == null ? null : dreams);}catch (RemoteException e) {}String dreamEnableComponentNames = “com.skyworthdigital.filexplorer/com.skyworthdigital.weather.main/com.skyworthdigital.ihome.settings/com.study.pumpkinstudy/com.android.dreams.phototable”;Settings.System.putString(mContext.getContentResolver(),Settings.System.DREAM_ENABLE_COMPONENT,dreamEnableComponentNames);try {long currentTimeout = Settings.System.getLong(mContext.getContentResolver(), SCREEN_OFF_TIMEOUT);if (currentTimeout < 0) {Settings.System.putInt(mContext.getContentResolver(),SCREEN_OFF_TIMEOUT, 2147483646);}currentTimeout = Settings.System.getLong(mContext.getContentResolver(), SCREEN_DREAM_TIMEOUT, -1);if (currentTimeout < 0) {Settings.System.putInt(mContext.getContentResolver(),SCREEN_DREAM_TIMEOUT, 240000);}} catch (SettingNotFoundException e) {e.printStackTrace();}}() {Settings.Secure.putString(mContext.getContentResolver(),Settings.Secure.ENABLE_RUNNING_BACKGROUD_COMPONENTS,”android/system/com.android/com.mipt/com.skyworth/com.google.android/com.skydigital/com.sky/com.starcor.hunan/com.explorer/com.slanissue.tv.erge/eu.chainfire.perfmon”);}() {Settings.Secure.putString(mContext.getContentResolver(),Settings.Secure.ENABLE_AUTO_LAUNCH_COMPONENTS,”com.android/android/system/com.mipt/com.skyworth/com.mipt.metro.launcher/com.skydigital/com.sky/com.starcor.hunan”);}() {Settings.Secure.putString(mContext.getContentResolver(),Settings.Secure.ENABLE_LAUNCHER_COMPONENTS,”com.mipt.metro.launcher”);}}

还要高声歌唱。那歌声,一定是响遏流云的,

Android app黑白名单

相关文章:

你感兴趣的文章:

标签云: