【Android性能优化-电量优化-App Standby Bucket-API28-Android_P】

Android电量优化进展

  • IceCreamSandwich 4.0 4.0.3, 14 15
  • Jelly Bean 16 17 18, 4.1 4.2 4.3
  • KitKat 19, 4.4
  • KitKat wear 20, 4.4w
  • Lollipop 21 22, 5.0 5.1
  • Marshmallow 23, 6.0
  • Nougat 24 25, 7.0 7.1.1
  • Oreo 8.0 8.1, 26 27
  • Pie 9.0, 28
  • Q 29, 10.0
  • R
  1. Doze mode (Marshmallow)
  2. App Standby (Marshmallow)
  3. Limited implicit broadcasts (Nougat)
  4. Release cached wakelocks (Oreo)
  5. Background service limitations (Oreo)
  6. App standby buckets §
  7. Background restricted apps §

APP Standby buckets

  • Android P 9.0、API 28 引入的 新的电源管理特性。standby(备用的) buckets(桶)
  • 基于APP的 how recently(近期)and how frequently(频率)对APP的资源请求划分优先级
  • 共有5个优先级(被称为five priority buckets,5个优先级桶),系统根据APP所处的bucket,来限制其资源访问
    1. Active
      • 正在被使用
      • 刚刚被使用
      • 不进行资源限制
    2. Working set
      • 经常使用(社交类app,微信)
      • Job调度延迟 2小时
      • Alarm延迟 6分钟
    3. Frequent
      • 频繁使用,但不是每天 (特定场景,keep、淘宝)
      • Job 延迟 8小时
      • Alarm 延迟 30分钟
    4. Rare
      • 不经常使用
      • Job 延迟 24小时
      • Alarm 延迟2小时
      • 网络 延迟24小时
    5. Never
      • 安装后,从未运行过
      • 最严格的显示(没标明。。。)
  • 手机厂商可自定义 非active的app,要放在哪个bucket

作用时间、范围

  • 手机低电量时
  • 手机充电时无效
  • 在Doze白名单中的APP,不受 App Standby Bucket限制

限制的资源

  • Job运行
  • Alarm触发
  • FCM(Firbase Cloud Message,google的信息推送)的优先级
  • 网络访问(只有Rare bucket被限制)

优先级依据

  1. 机器学习预测case
  • 通过机器学习进行 行为预测
  • 基于预测,而不是 最近使用 决定应用所属bucket
  • 例如, 最近使用过一次的app,被放在rare buckeet,因为 机器学习 预测app不会被使用几个小时
  1. 不进行预测的case
Active
  • The app has launched an activity
  • The app is running a foreground service
  • The app has a sync adapter associated with a content provider used by a foreground app
  • The user clicks on a notification from the app

activ的bucket状态不限制

Working set

An app is in the working set bucket if it runs often but it is not currently active. For example, a social media app that the user launches most days is likely to be in the working set. Apps are also promoted to the working set bucket if they’re used indirectly.

If an app is in the working set, the system imposes mild restrictions on its ability to run jobs and trigger alarms. For details, see Power management restrictions.

Frequent

An app is in the frequent bucket if it is used regularly, but not necessarily every day. For example, a workout-tracking app that the user runs at the gym might be in the frequent bucket.

If an app is in the frequent bucket, the system imposes stronger restrictions on its ability to run jobs and trigger alarms, and also imposes a cap on high-priority FCM messages. For details, see Power management restrictions.

Rare

An app is in the rare bucket if it is not often used. For example, a hotel app that the user only runs while they’re staying at that hotel might be in the rare bucket.

If an app is in the rare bucket, the system imposes strict restrictions on its ability to run jobs, trigger alarms, and receive high-priority FCM messages. The system also limits the app’s ability to connect to the internet. For details, see Power management restrictions.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值