【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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章