Commit graph

29 commits

Author SHA1 Message Date
Bruno Martins
e7dad9c0bf
samsung: Doze: Migrate to androidx
Change-Id: Ifaa67283a3437549a2304088a0ce377b399da19f
2020-03-20 14:56:44 +01:00
Anton Hansson
e603bb91e6
samsung: 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: Iabb0556dc1c80c7fc7f6c76d61d5e441b03cdce0
2020-03-20 14:56:43 +01:00
Paul Keith
7acbd6f735
samsung: doze: Rename to avoid conflicts with AdvancedDisplay
Change-Id: I669835f3563b9eea4fce6db45552c0e3a0888911
2020-03-20 14:56:43 +01:00
Bruno Martins
8bb8f47dd2
samsung: 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: I71ea2c118dcfd387904d04516572902babb16e35
2020-03-20 14:56:42 +01:00
Bruno Martins
a4b1e16b80
samsung: doze: Build with AAPT2
Change-Id: Id0a60b490a504010dc8b3f16aa495044719a4062
2020-03-20 14:56:42 +01:00
Arne Coucheron
2f5533648a
samsung: doze: Rebrand from cyanogenmod to lineageos
Change-Id: I619080f46a69a80fe3923cb3df6a676242f36eac
2020-03-20 14:56:41 +01:00
Zhao Wei Liew
129f7cba1a
samsung: doze: Remove extraneous meta-data
We aren't using this currently, so get rid of it.

Change-Id: I3f35f65ebfd9e41d646211b982f3272c2bfd519f
2020-03-20 14:56:41 +01:00
Sean hoyt
f1c7c30e5d
samsung: doze: specify a qualified user to send the pulse broadcast
Should fix this:

W/ContextImpl(3700): Calling a method in the system process without a qualified user:
android.app.ContextImpl.sendBroadcast:877
android.content.ContextWrapper.sendBroadcast:421
com.cyanogenmod.settings.device.SamsungDozeService.launchDozePulse:151
com.cyanogenmod.settings.device.SamsungDozeService.-wrap1:-1
com.cyanogenmod.settings.device.SamsungDozeService$SamsungProximitySensor.onSensorChanged:81

Change-Id: I680a57c9010d06719c3bd014001b00353f8e12fd
2020-03-20 14:56:40 +01:00
Gabriele M
bf82c89c3f
samsung: doze: Protect com.android.systemui.doze.pulse
As stated in ActivityManagerService:

  The vast majority of broadcasts sent from system internals
  should be protected to avoid security holes

Change-Id: I1dc989d9d132d40835ca8dbf277285eb88e30a58
2020-03-20 14:56:39 +01:00
Zhao Wei Liew
adbe1f2390
Revert "Revert "samsung: doze: Add back button to action bar""
As of commit 8cd28f3bce5612d35c4b6196554c7e2846057310,
this app no longer lives on the Settings dashboard.

This reverts commit a75b016e61ef544abdadf4c5e7a508c04b18c8dc.

Change-Id: If5b1fa89ddcc9de3c93217ef79189ad9ebd5193d
2020-03-20 14:56:39 +01:00
Zhao Wei Liew
4149f987d2
samsung: doze: Move to display settings
Reduce the clutter on the dashboard and move the ambient display
settings to where it belongs - in the display settings.

Change-Id: Ib08cc799e9f58884465b1730ce794cbc8be080f9
2020-03-20 14:56:38 +01:00
Zhao Wei Liew
b48065afed
samsung: doze: Clean up ambient display pref dependencies
* Use SecureSettingSwitchPreference for Ambient Display
 * Use the XML preference dependency attribute

Change-Id: I3480af71e334110aed834a53f49b33a853f16316
2020-03-20 14:56:38 +01:00
Abhisek Devkota
f62a187de7
samsung: doze: Commonize strings translations
* Translations moved to the new project
    android_packages_resources_devicesettings

Change-Id: I06536915e1963a2fe464c3d6c46dd8728aba0cb4
Signed-off-by: Adrian DC <radian.dc@gmail.com>
2020-03-20 14:56:37 +01:00
Zhao Wei Liew
ac9edab025
samsung: doze: Improve Settings search UX
Currently, the preference titles are very vague and confusing,
with no way for the user to understand what the preferences
do at a glance (e.g. in Settings search).

Make the purpose of the preferences more explicit through the titles.

Also, the current drawable is colored white, when it should be
colored green. This results in a near-invisible icon in the
Settings search results.

Color the drawable the appropriate teal instead.

Change-Id: I2dac9a73e8689f14d676b41922e0eba364c6500f
2020-03-20 14:56:37 +01:00
Zhao Wei Liew
6d0ea5b8c8
samsung: doze: Integrate with Settings
Bring this up to speed on the Settings changes in N:
 * Use support libs for preferences
 * Hook up to Settings drawer through SettingsDrawerActivity

Change-Id: I9365b3ebd1bbfed2936302e30da50e3f9af06665
2020-03-20 14:56:36 +01:00
Zhao Wei Liew
257f8c1d0c
Revert "samsung: doze: Add back button to action bar"
Starting N, top-level Settings activities should a drawer menu up
on the action bar. Remove the up/back button as it is now obsolete.

This reverts commit 5cfd7e76cf8099ebd22f4580cac8ed2217c3ead4.

Change-Id: I07af4c08a12bafbef424d01f62521cf226abbc2f
2020-03-20 14:56:36 +01:00
Danny Baumann
13a4f5e8ae
samsung: doze: Use new mechanism to include tiles into settings dashboard.
Change-Id: I91cce3ee6faac16402c84f08e4957b1e3722eaa6
2020-03-20 14:56:35 +01:00
KhasMek
7944079337
samsung: doze: remove screen_gestures_panel_summary
The gestures settings are the only settings on the
  main screen to contain a summary line, and it looks
  extremely out of place.

Change-Id: I2cacef71e8db204ab4380f77d9282009e0e5df03
Signed-off-by: KhasMek <Boushh@gmail.com>
2020-03-20 14:56:34 +01:00
Michael Bestas
585154922b
samsung: doze: use ScreenType util from cmsdk
Change-Id: I73b610bc71bf07b2fdedb1d5c5931e90f1e6de0f
2020-03-20 14:56:34 +01:00
Dave Daynard
e77e89d958
samsung: doze: fix typo
Change-Id: Id7716387688080b5ce0a99a4d968e210d8eed6f9
2020-03-20 14:56:33 +01:00
Patrick Lower
d3e7105606
samsung: doze: properly fix future timestamp error
Previously attempted fix at review.cyanogenmod.org/#/c/104083/
The timestamp isn't in the future, that would be impossible.
The real issue is the timestamp from the SensorEvent is a true
timestamp, the System.nanoTime is nanoseconds since boot.
So the previous patch would always return false and never pulse.
I've simply changed it so that the wakeup call gets sent the current
System.nanoTime in milliseconds since boot so it does not think the
event came from the future since the wakeUp method expects
uptimeMillis, not true world time.

Change-Id: I78f5e9d61107caf9c3bf6c10fa7c5bb400082294
2020-03-20 14:56:33 +01:00
Brandon McAnsh
73c756d2b4
samsung: doze: Prevent a pm wakeup with a timestamp in the future
Prevents:

java.lang.IllegalArgumentException: event time must not be in the future
at android.os.Parcel.readException(Parcel.java:1550)
        at android.os.Parcel.readException(Parcel.java:1499)
        at android.os.IPowerManager$Stub$Proxy.wakeUp(IPowerManager.java:550)
        at android.os.PowerManager.wakeUp(PowerManager.java:666)
        at com.cyanogenmod.settings.device.SamsungDozeService$SamsungProximitySensor.shouldPulse(SamsungDozeService.java:95)
        at com.cyanogenmod.settings.device.SamsungDozeService$SamsungProximitySensor.onSensorChanged(SamsungDozeService.java:75)
        at android.hardware.SystemSensorManager$SensorEventQueue.dispatchSensorEvent(SystemSensorManager.java:405)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:143)
        at android.os.Looper.loop(Looper.java:122)
        at android.app.ActivityThread.main(ActivityThread.java:5289)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)

Change-Id: I8ed248271d67216e531b124bf27101fa538f1195
Signed-off-by: Brandon McAnsh <brandon.mcansh@gmail.com>
2020-03-20 14:56:32 +01:00
Dave Daynard
3198b9b632
samsung: restore proximity wake preference on boot
Change-Id: I614772d6ff1005968a7f8f1ed0349e3878ddadf1
2020-03-20 14:56:32 +01:00
Dave Daynard
e798b625a7
samsung: doze: add proximity wake
Change-Id: Ib02f4611e7b8bc09d540ca5c49aab68ef27f188b
2020-03-20 14:56:31 +01:00
luca020400
78fa4868ed
samsung: doze: Add back button to action bar
Change-Id: Ia56183c8c2d5a6bc25c84f1d1b9823b84bc936c9
2020-03-20 14:56:30 +01:00
Dave Daynard
7916483736
samsung: doze: fix defaults
Change all defaults to false

Change-Id: I2df507b2fc823d3fb07bce89d44067db565a5ab8
2020-03-20 14:56:30 +01:00
Christopher R. Palmer
fcd3f34dc6
samsung: doze: Consolidate doze settings
* Allow user to disable ambient display from gesture panel
* Disable/enable doze settings based on ambient display state

Change-Id: I0ff7686ccc04037b3ada9a8355384ba6746cf30c
2020-03-20 14:56:29 +01:00
Arne Coucheron
d9bdd41975
samsung: doze: Set gesture to disabled by default
Change-Id: I0bf3f6a3a4c01bab7ff7522e916e2149f9cfe8d5
2020-03-20 14:56:29 +01:00
Patrick Lower
c8668b2755
samsung: doze: Add service for using proximity sensor for wake-up
* Added custom service that uses proximity sensor in wake-up mode
  to trigger display on
* If more sensor triggers are suitable to use, they can be added
  to the service

Change-Id: Id0849fb5c17ff569d771a19cebfc579dc93dbc48
2020-03-20 14:56:24 +01:00