Skip to content

Instantly share code, notes, and snippets.

@pistatium
Created June 29, 2015 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pistatium/b23b1604d47460e03ce1 to your computer and use it in GitHub Desktop.
Save pistatium/b23b1604d47460e03ce1 to your computer and use it in GitHub Desktop.
まったりAndroid Framework Code Reading #1 Memo

Android Doze

Dozeとは

センサーを利用して、ユーザーが端末を使っていない時にバッテリーの消費を抑える機能…らしい。

使い方

http://androidlover.net/android-os/android-m/android-m-how-to-use-doze-mode.html

  • アプリごとにDozeモードの有効・無効が切り替えられる
  • 有効なアプリに対しては通信やWifiスキャン等が抑えられる
  • デフォルトではGooglePlay開発者サービス等一部アプリ(サービス)をのぞいたすべてに対して有効になっている

ソースを読んでみる

http://tools.oesf.biz/android-MNC/search?q=Doze&defs=&refs=&path=&hist= Dozeでgrep

/com/android/systemui/doze

  • DozeHost
    • Interface the doze service uses to communicate with the rest of system UI.
  • DozeLog
    • ログクラス
  • DozeService
    • Earliest time we pulse due to a notification light after the service started.

DozeService

extends DreamService

  • onAttachedToWindow()
    • setup用
  • onDreamingStarted()
    • Dream開始時
    • power_saveやcar_mode中はexit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment