Commit Graph

217 Commits

Author SHA1 Message Date
LuK1337
f7d8e15b75 lineage-sdk: Fix moveTaskToFront() call in ActionUtils
* moveTaskToFront() now has 2 nullable parameters at
  the beginning:
    - IApplicationThread appThread
    - String callingPackage

Change-Id: I761784bdb3918021a0848e8ee31baa0818540bb1
2019-09-09 07:33:54 +02:00
Sam Mortimer
3533d385d9 lineage-sdk: Migrate to androidx
* Migrate from support library to androidx

* Various improvements and cleanup by @bgcngm

Change-Id: I10bbf5056125e8309f344c3eb18cc628bd7ec34e
2019-09-09 07:09:59 +02:00
Paul Keith
eb05519d5d sdk: Remove lineagehw compat
Change-Id: I329a74b5e489cc39d183697c25bb9771ae5afd82
2019-09-06 00:38:33 +02:00
Han Wang
d952ef3afb lineage-sdk: Refactor ActionUtils
* Use getFocusedStackInfo() to check active task, also do general
   cleanups for this class. Hopefully this will get rid of the
   strange issues of "kill foreground app" feature.

Change-Id: Ice1ca8e088ea4fec050fa171d990cb938dd3272c
2019-08-30 12:25:30 +02:00
Sam Mortimer
453cab629f lineage-sdk: Fix traffic stats for tethering and vpn use cases
Problems with current TrafficStats.getTotal[RT]XBytes()
implementation:

* Tethering related traffic is not counted at all.

* If you have a VPN active, stats are double counted.

So change the approach and track traffic on all non-VPN Internet
capable networks since:

* Tethering traffic is included in interface specific stats
  (unlike getTotal*).

* VPN networks are excluded so no longer double counted.

* Works correctly regardless of hotspot "Allow clients to use
  VPNs" hotspot setting.

* Works with simultaneous wifi ap and wifi upstream.
  (WIFI_HIDL_FEATURE_DUAL_INTERFACE = true)

Change-Id: Ic1135f10388b5be427202b092acd1444f94bd2b6
2019-08-25 22:05:20 +02:00
LuK1337
8942a9c49b sdk: Add LineageContextConstants.Features.FOD
Change-Id: I43f9a1f43c83fb83e7eac9c687a928d9bc0ba3f5
2019-08-24 10:25:50 +02:00
dianlujitao
63a590625c LiveDisplayService: Notify SystemUI after initialization finished
Change-Id: Id01eeee3bdfc599bdc20a5779db3d002fa4bc1c9
2019-08-20 17:17:28 +02:00
dianlujitao
62885acaca LiveDisplayManager: Perform null check in getConfig()
* LiveDisplayConfig isn't instanced until boot completed, thus if
   LiveDisplayManager is instanced earlier, null is always returned.

Change-Id: I003886ffced86a5a82dec25a4cc7b542da0f2331
2019-08-20 17:17:28 +02:00
Sam Mortimer
c0d4150a7f linage-sdk: Add secure setting to allow tethering via VPN upstream
Change-Id: I4665be19f425c47766f29da5993fd18b19352b4b
2019-08-20 10:53:05 +02:00
Sam Mortimer
eaedf7be02 sdk: Add volume panel left/right setting
Change-Id: I378e07bbed1fa438323be1ceaaeb6f9189daea45
2019-06-09 21:02:51 +02:00
Hendrik Hagendorn
5ded0fcf6c sdk: Update for refactored battery icon options
* Handle the migration for old settings and default
   to Android's stock battery style.
 * Hiding battery icon is now achieved using icon blacklist
   via system tuner settings.

Change-Id: Ie41d71c774a34abe225e2c0a6a0a9fd4316189cd
2019-06-02 22:27:30 +01:00
LuK1337
9cb69f81bd sdk: Remove VOLUME_KEYS_CONTROL_RING_STREAM
* No longer used since we removed preference from LineageParts.

Change-Id: Iff64a051762fd71a79d1ddfa52b3ca4b14f6a2bb
2019-04-12 10:18:48 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Paul Keith
505580e2dd sdk: Rework reading mode API
* The current API makes no sense, and doesn't really
  fit with how the other boolean features work
* While we're at it, place AutoContrast properly

Change-Id: I81d7805411c281e435c7451c0b62689711dbb323
2018-08-08 19:38:32 +02:00
Paul Keith
c2a5d543b8 sdk: Allow controllable brightness for non-RGB segmented battery LEDs
* For non-RGB segmented battery LEDs, we currently don't allow any kind
  of brightness control, because the alpha channel is taken up by the level
* To remedy this, set the brightness in the color channel like we do for
  setting panel backlight brightness by setting the brightness as R/G/B

Change-Id: I4e47861643e0b2b8766af0f2ff275069fc580108
2018-08-04 01:23:37 +02:00
LuK1337
e03fab80d2 sdk: Add minimal LineageSettingsService
* This service is currently used for loading custom hostname,
  it may be used for more than that in the future.

Change-Id: I9b4da124b54bdc28544becb2ad25b7b43d46f123
2018-08-02 17:30:35 +02:00
LuK1337
59ec383e3a Import preference class for custom hostname feature
Change-Id: I85383db3583eba75f675ad5e4a4be1379c012ef6
2018-08-02 17:30:35 +02:00
Tobias Tefke
5e5f905802 [2/2] Add vendor security patch level to device info
Change-Id: Ic65290aa2c5fa159512e16a3781bc407876b9e5a
2018-07-20 13:00:25 +02:00
Joey
a37b3cd4e5 styles: add support for more dark overlays
Change-Id: If9e08ba8ff28cff7a4061a6b6cea10d5fe38a541
Signed-off-by: Joey <joey@lineageos.org>
2018-07-08 17:02:36 +02:00
Joey
c8a06b9ff7 sdk: Trust: better warnings management
Allow fine-tuned management of trust warnings,
the user is now able to disable specific warnings
instead of blocking everything

Change-Id: I04c7aa5fba76fd7500fd70c0c874fa0c3e59e03a
Signed-off-by: Joey <joey@lineageos.org>
2018-07-06 11:27:11 +02:00
Michael W
fcf9ab5461 lineage-sdk: Introduce TelephonyExtUtils
Change-Id: Ifdd18dd6e89e23c5b804c3454ee8473a5920b562
2018-06-28 15:28:11 +02:00
Adrian DC
6fb50762ee NetworkTraffic: Resolve status bar indicators tints
* Apply the color tint with PorterDuff.Mode.MULTIPLY
    as the original color is white, with transparencies

 * Use the DarkReceiver tint's value as icons tint

 * Results: Before and after: https://ibb.co/k15ony

 * Test: Bright wallpaper with status bar contrasts:
    https://ibb.co/dxupSy

Change-Id: I4f31cf5a9a3db4018543603a891fa7967ccbb4a3
2018-06-26 00:47:17 +02:00
Tobias Tefke
fa05f27ad7 Trust: warn if build is signed with insecure keys
Change-Id: I1d58e232ed99dfe7e2addb651c114c1068e64105
2018-06-26 00:27:09 +02:00
Jesse Chan
5bfb5fafa6 sdk: Add an option to force pre-O apps to use full screen aspect ratio
When an app target pre-O releases, the default max aspect ratio
is 1.86:1 which leads to ugly black areas on devices that have
screens with higher aspect ratio (for example Galaxy S8/S9).

This change adds an option to allow users to change aspect ratio
for pre-O apps to full screen aspect ratio.

Change-Id: I2531542f736ee7b809ef7faffd72e5963e7d20d6
2018-06-12 00:45:46 -07:00
Joey
c0b21ca8ed sdk: Introduce Trust Interface
Change-Id: I5c3ece3f6035dd03be1ceab01020496c179f2e65
Signed-off-by: Joey <joey@lineageos.org>
2018-06-10 00:45:35 +02:00
Sam Mortimer
e703ff0a0b Add led capability LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS
*) Many existing liblights support notification brightness
   control via the alpha channel but do not support similar
   for the battery led.

*) 8f7a4559ab
   introduced a dependency on light capability
   LIGHTS_ADJUSTABLE_BATTERY_LED_BRIGHTNESS such that, when
   set, it was assumed that the battery led brightness is
   also liblights adjustable.  It turned out that this
   was not the case.

*) Create a new capability to allow devices to distinguish
   whether their liblights supports adjustable brightness
   control for notification and battery leds independently
   of one another.

*) Document how brightness support works in LightsCapabilities.

*) Copy LightsCapabilities comments to the default lights config
   to raise visibility.

Change-Id: Id95905f07128c78c6acacf3b60d71bb37f70bcfb
2018-06-05 20:26:52 +02:00
Rashed Abdel-Tawab
18fd692bbd lineage-sdk: Add backend for reading enhancement
Change-Id: Ibd1c9e057ddf8e9d21657aef0ebeeaa9a253e92d
2018-05-24 21:39:00 +02:00
Bruno Martins
285d9d6dbe LineageBatteryLights: Fix brightness for devices with segmented leds
* In case mCanAdjustBrightness was false, the brightness level would
   always be set to the maximum value.

Change-Id: I034bc17ac1174c491830f0a6cb1969a99ee900a7
2018-04-26 18:52:26 +02:00
Bruno Martins
bd4ca1f551 LineageBatteryLights: Take current user settings into account
Change-Id: Ie99c14a73c14e1f5b6c39125625153f2628f884d
2018-04-26 15:13:35 +01:00
Bruno Martins
89eb3d49de LineageBatteryLights: Rename some class members and add more debugging
* Follow LineageNotificationLights debug logic

Change-Id: I6b4a91db45a119c8c0b8b30684386765b73b93d2
2018-04-26 15:13:04 +01:00
Michael Bestas
8f7a4559ab lineage-sdk: Allow adjusting brightness of non-RGB LEDs
* Mimic LineageNotificationLights logic

Change-Id: Ifc0c899ef78dbdec22fa69ecd0bcffe1a9488afe
2018-04-22 03:22:14 +02:00