Commit Graph

926 Commits

Author SHA1 Message Date
Alexander Martinz
da392f9195 sdk: notification: allow forcing notification color for preview
Parts uses notifications to preview custom notification lights.
Since Android O we got NotificationChannels and the internal API uses
the color values of the channel instead of the color set at the notification.

To prevent unexpected breakage in future, introduce a flag to be used for
providing preview colors in a bundle to force said color.

Also introduce flags to control the ON and OFF duration.

Change-Id: Ifbb7995a19d95b6ddb2627c1b14dd201f9dc5430
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
2019-04-12 01:28:27 +02:00
Michael Bestas
952ef00123 Automatic translation import
Change-Id: I9a0517fe270f0b6f37b22bf2cc3ab9974e3fcdd1
2019-04-07 21:57:39 +03:00
Tim Schumacher
db39c9ac0a Revert "lineage-sdk: Add ACCELEROMETER_ROTATION_ANGLES to system settings"
This reverts commit 2f9375f4bc.

Change-Id: I88392e75170302fda06900abfd222845371d6771
2019-04-07 12:13:28 +02:00
Michael W
13e33b7116 Automatic translation import
Change-Id: If43774499b4bbea34c504b1a86ee4c2a1d09fc75
2019-03-11 17:21:03 +01:00
Michael Bestas
7c58c4c5fa Automatic translation import
Change-Id: Ia4b2bbf6b93883e87ed88d2d0acde820dfea3698
2019-02-26 19:00:28 +02:00
Paul Keith
c9f1d6744f sdk: Cleanup usage of List.toArray(T[] a)
* The parameter here only has to have the type you want it to return,
  so creating an array of size > 0 is unnecessary and wasteful

Change-Id: I28e490fb6fa3703d7edca21b29d640105072947b
2019-02-17 23:31:00 +01:00
Paul Keith
d6a273df74 sdk: LineageHardwareService: Add fallback to HWC2
* We can't talk to DisplayTransformManager in C++, so
  we must have a fallback in the SDK itself for HWC2
* While we're at it, fix the size of the int array created
  in getDisplayColorCalibration() to be 5 rather than 6

Change-Id: Ic524f7d60ae1585efed3fba676cf3301dcaecd7f
2019-02-08 07:16:42 -06:00
Paul Keith
5f6587d5f3 sdk: HIDLHelper: Remove public access modifier
* The default access modifier is sufficient here

Change-Id: I174757643b385b73f64420cc66a92828a9d0a045
2019-02-07 12:44:53 -06:00
Luca Stefani
231167efe0 Add emergency power menu constant
Change-Id: I44555b31ff14a5d14de7395b88f44d7be93e06f1
2019-02-06 14:09:34 +01:00
Michael Bestas
fab8bbfd32 LineageSettingsProvider: Fix migration of FORCE_SHOW_NAVBAR
* It was moved from Global to System but no migration was in place
  to handle upgrades from previous versions.

Change-Id: If76243b0224dbc0138cf3c5dbc8aaeefa69f06a4
2019-02-04 22:39:33 +01:00
Joey
0cf297348d sdk: add Trust usb restrictor
Change-Id: I8ba443606e83fcfc6f23e62f434f10f25eb69e1b
Signed-off-by: Joey <joey@lineageos.org>
2019-02-04 20:48:15 +01:00
dianlujitao
d853f892aa PerformanceManager: Allow wait for MPCTL to start on boot
* For devices using Qualcomm MPCTL interface as power profile backend,
   setting the user's profile preference fails on boot, because we call
   perf_lock_acq before MPCTL is ready.
 * To fix the issue, add an option to wait for MPCTL service to start
   before setting stored power profile.
 * We should not only wait for the service to start but also post boot
   parsed property to be set, because MPCTL service won't actually
   initialize if the property is not set to 1.

Change-Id: Ib749c3eb548dad0ab24868ee0048247a0b80dd6a
2019-02-04 19:32:01 +01:00
Bruno Martins
a7d159461d LiveDisplayService: Catch NPE before LiveDisplayConfig is initialized
* During boot up phase the system is trying to update
   LiveDisplay tile status based on the applied mode.
   However, with LiveDisplayConfig not yet initialized this results
   in a NullPointerException. Address it and fallback to MODE_OFF.

Change-Id: I736da21455e74801aae69e16b9e80c8985b83a5a
2019-02-04 19:31:43 +01:00
Luca Stefani
dc5d872a2f LineageAudioService: Make audio session broadcast explicit
Change-Id: Ia6a2a2a9840912e1a4317e11229ca5dc69bd376a
2019-02-04 18:50:51 +01:00
Paul Keith
b49ed55600 sdk: Add HIDL compat in LineageHardwareManager
* While we're at it, hide the use of getSupportedFeatures(),
  since it only works for lineagehw java features, not hidl
* Cleanup some minor styling/organization issues

Change-Id: I905010bc7c6d7d8578eeca501be23f665127aa27
2019-02-04 14:43:29 +01:00
Paul Keith
7368c8e988 sdk: Deprecate some unused lineagehw features
* DISPLAY_GAMMA_CALIBRATION
* LONG_TERM_ORBITS
* SERIAL_NUMBER
* While we're at it, cleanup tests for removal of other features too

Change-Id: I1a572cf3bcc5298d208a3dc234f9d82da1105bf0
2019-02-04 14:43:29 +01:00
dianlujitao
c918a033c3 TelephonyExtUtils: Handle extphone binder death
* If extphone binder service is invoked after death, phone service
   would crash due to android.os.DeadObjectException.

Change-Id: I8dec7bfd709b0443654001ecd67219a2ba8cc134
2019-01-25 15:36:04 +08:00
Han Wang
7dfc51aee4 sdk: Trust: Return TRUST_FEATURE_LEVEL_BAD on encryption inactive
* Prepare to change the logic in Trust frontend.

Change-Id: I8fafdc891bdc17eb92fbfe4be33ed2cd074bad74
2019-01-21 15:55:27 +01:00
nico
eef2974c7f TelephonyExtUtils: Set timeout for (de)activating provision
* catch OEM RIL being unresponsive to UICC provisioning request

Change-Id: Ic28c01412bffaec4cadabd3d68434ddef75693ef
2019-01-21 15:55:09 +01:00
Han Wang
68a1d795d3 lineage-sdk: Remove useless logic on database upgrading
* The upgradeVersion < newVersion part is never reachable because we
   increase upgradeVersion unconditionally. Make it back to stage by
   nuking it as no one has experience issues before.

Change-Id: Icac1e18c192292ad3147fd4af4c862e93ef34ba5
2019-01-19 17:07:54 +01:00
Paul Keith
a7d4dff902 sdk: Split TWILIGHT_ADJUSTMENT_TIME in half
* The difference between civil and actual sun{rise,set}
  is 6 degrees of movement of the Sun in its path in
  the sky, astronomically speaking
* Since the Sun "travels" at 15 degrees/hr in the sky,
  that means the difference between civil and actual sun{rise,set}
  is about 24 minutes, temporally speaking
* In order to more closely match that temporal difference,
  the TWILIGHT_ADJUSTMENT_TIME should be about 30 minutes

Change-Id: I30a600c71ce5dd01fcb96fb4f5108f45fa493b0c
2019-01-19 05:24:14 +01:00
Paul Keith
bd9f127ef8 sdk: Stop using lerp for night/day mode transitions
* This makes it clear what the desired behavior is
* In order to make the logic more clear, also start
  scaling into night mode before civil sunset so that
  we finish by civil sunset -- this makes sure that
  by the time there's no light out for practical
  purposes, we are in night mode
* While we're at it, add a few comments about what
  each return is supposed to do, for the future

Change-Id: I4ec0f8eec6b0129a37e99f9e3a2b3f124aeeb4f2
2019-01-18 23:33:21 +01:00
Wang Han
0b12914dbf Revert "[3/3] cmsdk: add burnIn protection setting"
* Our overlay name now confuses people as Google introduced a screen
  burnin protection feature for ambient mode in Oreo. Just re-use AOSP
  one and kill this.

This reverts commit 088ddf5aaf.

Change-Id: Ia76b28444cd7b117559062fbd8230602962616b2
2019-01-18 16:47:09 +01:00
Michele Bono
d58f2db1d9 ConstraintsHelper: Fix checking for a boolean system property
Change-Id: I62b9e1cc8a4896062a3ffddbf2c33c566fd592dc
2019-01-14 21:31:26 +01:00
Michael Bestas
bbc2643632 Automatic translation import
Change-Id: I0256f07ce9acdc90e9cd4b25c6c28608cd6cade8
2019-01-12 20:02:23 +02:00
Steve Kondik
eaf833a4e4 lineage-sdk: Start Weather service in onUnlockUser.
After reboot the active WeatherProvider is started (onBootPhase)
  too early, resulting in WeatherProvider not syncing anymore.

  Start the active Provider when userland apps are ready to fix this,
  like on 14.1:
  0cee14b03c

  Found by meiser@xda

  lineage-15.1 ready Weatherproviders for testing:
  https://github.com/nvertigo/android_vendor_nlos/tree/nlos-15.1/weatherproviders

Change-Id: I8d3eb7aacaf265c55d5d0b5157731e04068a7c7d
2019-01-06 05:09:41 +01:00
dianlujitao
0c66c31d1f ProfileManager: Don't start before decrypted
* WiFi service is not considered as a core service so it won't start in
   min framework, but ProfileManager accesses to WiFi service's API.
   This would lead to a fatal exception and trigger RescueParty.
 * We don't really need ProfileManager during such early stage, so
   simply disable it to avoid invoking WifiManager.

Change-Id: I2c66217599e0062eaff2e5f4e86ebc092d4a41d5
2018-12-08 11:47:58 -06:00
LuK1337
50e230446a lineage-sdk: Fix setting default def_force_show_navbar value
* DEV_FORCE_SHOW_NAVBAR has been renamed and moved to System.

Change-Id: I5aecbd66769b332692a4b54a1ba1d88b4679ed1d
2018-12-04 14:32:11 +01:00
Sam Mortimer
11c1619fed lineage-sdk: Use AOSP permission CHANGE_OVERLAY_PACKAGES for styles
*) Replace lineageos.permission.CHANGE_STYLE with
   AOSP android.permission.CHANGE_OVERLAY_PACKAGES.

Change-Id: I2dfb339688795ad5a7ae70d8d60a7dc51bbdb4cb
2018-11-10 11:01:03 -08:00
LuK1337
7702fb29a8 sdk: Don't clear calling identify when calling IOverlayManager.setEnabled()
* Since changing overlays is now guarded with enforceCallingPermission()
  instead of enforceCallingOrSelfPermission() we can no longer call
  setEnabled() after resetting our identify.

Change-Id: I25df30d0ba83f15ca1124d6fc6f79d3465d052f2
2018-11-09 17:04:10 -08:00
Sam Mortimer
9f0adb656e lineage-sdk: Make styles init at system services ready
*) On pie, lineage system server is starting before
   overlay manager service so mOverlay was being
   initialized with null (and crashing).

*) Change to only attempt to get service handles after
   boot phase system services ready.

Change-Id: I4965ce6015275a421e2e3864e66e77b8c15477f0
2018-10-24 11:11:51 -07:00
Nvertigo
3106747fdc sdk: resources: Fix lights related comments
Change-Id: I181621e4f9388ec398a79758eb96fd8c4ac08273
2018-10-22 02:03:41 +02:00
Sam Mortimer
84d90ce2a1 lineage-sdk: Bump PREF_HAS_MIGRATED_LINEAGE_SETTINGS for 16.0
Change-Id: Ia88d36533c0b0a2dd8ca18e93de5d03441dd8092
2018-10-09 23:35:27 +02:00
Sam Mortimer
cd0ec5ba84 LineageSettingsProvider: Cleanup after LINEAGE_SETUP_WIZARD_COMPLETED deprecation
Change-Id: I997759d1f79fae514566e6474ea7802c2c7d1f53
2018-10-05 18:46:34 +02:00
LuK1337
c5e6a03d01 sdk: Update default clock position
* Also migrate users using right clock so
  that they get the new default setting.

Change-Id: I2e38a16af46d77ff92ada268b8fc0927b0c4806c
2018-10-05 01:41:13 +02:00
Sam Mortimer
55db77b688 lineage-sdk: Move force show navbar to lineage system settings
*) Mild cleanup of DEV_FORCE_SHOW_NAVBAR in the process.

Change-Id: I519245ffb350c172bb1eef2b0d507089fc87907c
2018-09-27 23:09:04 -07:00
Giuseppe Barillari
055065c16f lineage-sdk: Default config_deviceHardware{Wake}Keys to 64
* New devices don't have hardware navigation buttons

Change-Id: I989ec6f7f07fd746c24b3eecb527412e3c5ec0e0
Signed-off-by: Giuseppe Barillari <joe2k01dev@gmail.com>
2018-09-28 00:44:19 +02:00
Bruno Martins
1ad7a3b010 PowerMenuConstants: Add user logout as new global action
* Google introduced user logout in Pie:
   044588599c

Change-Id: I60a64beb5fc69e89d5872c74439bec30a47d4d0c
2018-09-16 16:49:10 +02:00
Sam Mortimer
4545327294 lineage-sdk res: Set no_framework_libs true
*) Don't depend on framework libs when building our org.lineageos.platform-res
   package (as per framework-res bp).

*) It doesn't work out of the box because our resources refer to android: framework-res
   attributes (and compile fails).

*) We can fix this in soong by making org.lineageos.platform-res depend on
   framework-res (see topic:pie-sdk-no-framework-libs).  This allows us to
   build with no_framework_libs true.

Change-Id: I426d44ef2521971adfc6b8ad33a7cc042b04e0e6
2018-09-05 17:53:43 +02:00
Luca Stefani
95285d122f Make livedisplay off drawable look-alike day
* The magic is in the background now!

Change-Id: I7046643c8a1a36b29cf9718e36515a0b45891c6b
2018-09-05 10:37:46 +02:00
Luca Stefani
432de0df67 Fix LiveDisplay drawable off color
Change-Id: Id5800609a6264e214e6419fea2eecb6e8e4902d1
2018-09-05 10:37:32 +02:00
LuK1337
cb1d854001 sdk: Add migration for /missing/ custom button actions
* Since we removed onehand from settings
  we need to make sure user doesn't have them
  set in settings otherwise we will hit
  ArrayIndexOutOfBoundsException exception.
* Fixes : BUGBASH-1525

Change-Id: I7a5737ecfe5e70c3f0108c03b3e8745eade80433
(cherry picked from commit eb8fc0648f645a265ce8d1b6daf575795eb69510)
2018-09-04 00:47:18 +02:00
LuK1337
7f0d1fa173 lineage-sdk: Rewrite Lineage preference classes used in about phone view
* Now extending TextView to match Android P settings.

Change-Id: Ieed7174a92e3801e6c782b39c36731a67ae1be59
2018-09-03 01:01:00 +02:00
Luca Stefani
21be710a95 ActionUtils: Switch getLastTask to IActivityManager
* An alternative to using the getRecentTasksForUser method
   that got removed with the following commit:
   5fa397533f

Change-Id: I752c2445c3ffc0933dfe6290c99d839a036e4bc3
2018-09-01 16:05:09 +02:00
Rashed Abdel-Tawab
703249ae8d lineage-sdk: Android.mk -> Android.bp
Change-Id: Iac2bd318e7ceb6b96e30d26832d98b7b2726cd5b
2018-08-30 02:31:18 +02:00
Sam Mortimer
8daa2ca6ae LineageSettingsProvider: Don't set LINEAGE_SETUP_WIZARD_COMPLETED
*) This was initialized from Settings.Global.DEVICE_PROVISIONED and it is no
   longer possible to access system settings during provider startup since:
235272a216

*) LINEAGE_SETUP_WIZARD_COMPLETED has been deprecated since 14.1:
797a45aa69

*) We will later cleanup the unused setting during topic:pie-db-upgrade

Change-Id: I185648ca25995fae80362642d297573795d04bfa
2018-08-30 02:29:52 +02:00
LuK1337
25c4fbbe52 lineage-sdk: Don't rely on EXTRA_WIFI_INFO when getting current SSID
* Nothing sets it anymore therefore it's always null.

Change-Id: I852e03acfd6fce9f51437cf5ad22b687ef1f083f
2018-08-29 09:19:30 +02:00
Sam Mortimer
a713e602ef lineage-sdk: Use PreferenceDataStore for lineage-sdk preferences
Replaces the need for:
32e67e6020

*) frameworks/support are now built with gradle and are included as prebuilts.

*) API level 26 (8.0) introduced PreferenceDataStorage which can be used
   to implement what we need without touching the support library.

Change-Id: Ide3417019ccf8bde5dca3b2aec3d2075e7c8b597
2018-08-29 09:15:38 +02:00
LuK1337
dee3258356 LineageNotificationLights: Don't create KeyguardManager in constructor
* Apparently creating it so early can cause serious breakages
  that make StorageManagerService and UsbDeviceManager end up
  getting null pointer when trying to get KeyguardManager with
  ctx.getSystemService(KeyguardManager.class).
* Moving ctx.getSystemService(KeyguardManager.class) out of
  constructor to isKeyguardLocked() solves these issues.
* Also move to getSystemService(Class<T>) while at it.

Change-Id: Ib3f65ba2e726149089ab1fb12030321e0ecdeab1
2018-08-25 20:58:11 +02:00
Rashed Abdel-Tawab
3cc3d4d2ad lineage-sdk: Update attr.xml for aapt2
*) the sdk is now using aapt2

*) aapt2 is unhappy with "lineage:..." name attribute value format
   (errors with invalid character).
   
*) update in a way that aapt2 is happy with

Change-Id: I96ecc14c4a6de00272a5ad4f513b62f21289ac45
2018-08-22 23:35:17 +02:00