Commit graph

13 commits

Author SHA1 Message Date
Bruno Martins
d315f08575 sdm710-common: Doze: Migrate to androidx
Change-Id: Ifaa67283a3437549a2304088a0ce377b399da19f
2019-08-29 10:03:59 +00:00
Joey
673e03d926 doze: Match Pie settings UI
Change-Id: Ia1cde37923c55faf057189f7085b69522e2802ef
2019-08-29 10:03:49 +00:00
Bruno Martins
56a25429aa Doze: Drop useless SDK dependency
Change-Id: I74901339740b82b79f36754c7e52894a98020c3d
2019-08-29 10:03:42 +00:00
Anton Hansson
d818ef2488 doze: Set LOCAL_PRIVATE_PLATFORM_APIS
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Bug: 73535841
Change-Id: I61299717ab2a6a1fd9a14dde7e1c7961388f722a
2019-08-29 10:03:32 +00:00
Bruno Martins
e817d534a0 Doze: Add missing preference listeners
* Otherwise, it resulted in Doze service not being activated
   when enabling one of the features for the first time after
   a clean installation.

Change-Id: I625d9109fb85c970f0e59b1cbcabba7d4375d2f3
2019-08-29 10:03:22 +00:00
LuK1337
764f507c35 Doze: Make use of real pickup sensor
* Use it for the pickup feature instead of the tilt sensor

Change-Id: I6172154e0cb0278fc0b7dc31d612f5e8ac619d90
2019-08-29 10:03:11 +00:00
ezio84
be68fd6e75 sdm710-common: doze: use ExecutorService for listener registration
Replicate what Google did for SystemUI in this commit.
fabc743bcf

Registering a sensor seems to be an expensive operation,
and we do it on each screen-on event, so moving it to
an asynchronous task looks like a good idea anyway.

By moving all non-essential binder calls of the main thread or to the
next frame, we bring this down to 5ms, such that window animation
and Keyguard animation starts about at the same time.

The interesting part about the ExecutorService:
"Memory consistency effects: Actions in a thread prior to the submission
of a Runnable or Callable task to an ExecutorService happen-before any
actions taken by that task, which in turn happen-before the result is
retrieved via Future.get()."
(from https://developer.android.com/reference/java/util/concurrent/ExecutorService)

Change-Id: I4f37bb9a7dc9d7775d587d4ebd4b6619f3b77e81
2019-08-29 10:02:54 +00:00
Bruno Martins
2f05326436 sdm710-common: Doze: Minor code simplification and clean up
Change-Id: Idff05f2626138c96dccd3ab4c26c4df1be40a606
2019-08-29 10:02:38 +00:00
Bruno Martins
a7e74415e0 sdm710-common: Doze: Build with AAPT2
Change-Id: Iab14804817e6b90bf4d773d9359a04f1e119264a
2019-08-29 10:02:22 +00:00
Bruno Martins
f0d2246d27 sdm710-common: Doze: Re-integrate into Settings
* Apply the default Oreo theme and inherit the layouts
   from Google for the Settings app, in order to keep
   UI consistency.

 * Get rid of SettingsDrawerActivity as it no longer fits in
   and include the back button in the action bar.

 * Kill the icon drawable not only because is a leftover,
   but also doesn't really serve any puropose in the new UI.

Change-Id: I53b6d3bb99d63852ba34d71e16ae99f05223569e
2019-08-29 10:02:10 +00:00
Bruno Martins
1dcb684eea sdm710-common: Doze: Apply LineageOS rebrand
Change-Id: I4daa1092494fdf207ef54dc79f787bcbe1d01a08
2019-08-29 10:02:00 +00:00
Álvaro Brey
ea1e874137 modules: doze: Fix devicesettings path
* Was broken when moved to modules, since it iss a relative path
Change-Id: I7d934e7cfeccdc4bcaaf917de1316e81b34ae220
2019-08-29 10:01:47 +00:00
xiaobai
91d1679e81 sdm710-common: import doze from mi5 2019-08-29 10:01:30 +00:00