2.关于Alarm
闹钟根据以上列表对每个组群的应用脑中进行延后调整:
private final long[] DEFAULT_APP_STANDBY_DELAYS = {0,// Active6 * 60_000,// Working30 * 60_000,// Frequent2 * 60 * 60_000,// Rare10 * 24 * 60 * 60_000// Never};
在设置闹钟时对应用所属的组群进行检查:
->
->cked
->
private boolean adjustDeliveryTimeBasedOnStandbyBucketLocked(Alarm alarm) {...final int standbyBucket = mUsageStatsManagerInternal.getAppStandbyBucket(sourcePackage, sourceUserId, SystemClock.elapsedRealtime());...if (lastElapsed > 0) {final long minElapsed = lastElapsed + getMinDelayForBucketLocked(standbyBucket);...}
3.关于
注册的监听器,根据上报的应用状态更新UID网络访问权限(待深入):
private class AppIdleStateChangeListenerextends UsageStatsManagerInternal.AppIdleStateChangeListener {@Overridepublic void onAppIdleStateChanged(String packageName, int userId, boolean idle, int bucket,int reason) {try {final int uid = mContext.getPackageManager().getPackageUidAsUser(packageName,PackageManager.MATCH_UNINSTALLED_PACKAGES, userId);synchronized (mUidRulesFirstLock) {mLogger.appIdleStateChanged(uid, idle);updateRuleForAppIdleUL(uid);//更新UID状态updateRulesForPowerRestrictionsUL(uid);}} catch (NameNotFoundException nnfe) {}}
void updateRuleForAppIdleUL(int uid) {if (!isUidValidForBlacklistRules(uid)) return;if (Trace.isTagEnabled(Trace.TRACE_TAG_NETWORK)) {Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "updateRuleForAppIdleUL: " + uid );}try {int appId = UserHandle.getAppId(uid);if (!mPowerSaveTempWhitelistAppIds.get(appId) && isUidIdle(uid)&& !isUidForegroundOnRestrictPowerUL(uid)) {//根据组群setUidFirewallRule(FIREWALL_CHAIN_STANDBY, uid, FIREWALL_RULE_DENY);} else {setUidFirewallRule(FIREWALL_CHAIN_STANDBY, uid, FIREWALL_RULE_DEFAULT);}} finally {Trace.traceEnd(Trace.TRACE_TAG_NETWORK);}}
4.FCM限制
国内无法使用FCM服务 。
一堆订单BUG,,溜了
- 一 Android基本知识—— 四大组件
- android 美团多渠道打包,美团多渠道打包原理以及使用
- 【论文笔记】ICRA2019 视觉里程计的损失函数:Beyond Photome
- 音视频入门基础——笔记
- android 权限 permission
- 【verilog】b站-小明教IC-1天学会verilog 笔记
- 图论学习笔记——连通度
- 操作系统学习笔记1 | 初识操作系统
- Android4开发入门经典 之 第二部分:Android应用的核心基础【私塾在
- 二 android 休眠唤醒机制分析 — early_suspend