Commit Graph

266 Commits

Author SHA1 Message Date
Gegham Zakaryan
ad4bce40b2 lineage-sdk: Add LineageGlobalActions service
The service will offer updateUserConfig, getUserConfig, and
userConfigContains methods, which will be used from LineageParts and
fwb. The service will also observe Settings.Global.BUGREPORT_IN_POWER_MENU
and Settings.Secure.LOCKDOWN_IN_POWER_MENU to update the GlobalActions
dialog when these are updated.

Signed-off-by: Gegham Zakaryan <zakaryan.2004@outlook.com>
Change-Id: I46663ab1ffe6f8d8b2a3dc7dbe54a65b7a62046a
2021-05-23 15:17:16 +02:00
Gegham Zakaryan
df05cf8b26 lineage-sdk: Follow AOSP order of PowerMenuConstants
Partially follow the order of config_globalActionsList and bring emergency and lockdown to top. Some of the order isn't followed as some items such as users and airplane don't exist in AOSP's list but are much more frequently used than, say, bugreport.

Signed-off-by: Gegham Zakaryan <zakaryan.2004@outlook.com>
Change-Id: Ie49e77fd99ad0f0dee7c6c7956fc7c1d0474ee63
2021-05-23 15:17:16 +02:00
Gegham Zakaryan
8e4a978315 Revert "sdk: Deprecate POWER_MENU_ACTIONS"
This reverts commit d8742f0727.

Signed-off-by: Gegham Zakaryan <zakaryan.2004@outlook.com>
Change-Id: I4071297652a6cd0a47d6c642909b32f742e60781
2021-05-23 15:17:16 +02:00
LuK1337
feae6f7481 lineage-sdk: Mark DEVICE_HOSTNAME as deprecated and drop code using it
* AOSP feature is now in place, which uses device name
   as DHCP hostname.

Change-Id: I4adbaca2d980017e5cd81e200729f03b245c6a3e
2021-05-20 22:41:51 +02:00
LuK1337
6fe262abf7 lineage-sdk: Disallow KILL_APP action when task is pinned
Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/3468
Change-Id: I8420d5531422e9ed25588cd6e5198e14472569e5
2021-05-13 19:34:48 +02:00
LuK1337
1167224e01 lineage-sdk: Retire HostnamePreference as net.hostname no longer works
Change-Id: Ibecaccd5f853570fb4e02cba7274429f2bb037b2
2021-05-12 11:22:12 +02:00
LuK1337
7378e73713 lineage-sdk: Add KILL_APP button action
This partially reverts commit 9eca90278d.

Change-Id: I9bfc039540936e4dbd4313c8f368ce3e3e445290
2021-05-04 13:40:17 +02:00
LuK1337
44427ae3ef lineage-sdk: Add preference keys for back key long press customization
Change-Id: I8a5d80ef5f8aa238ad73ba034d275ea1094dffe9
2021-05-04 13:39:13 +02:00
LuK1337
122825fa60 lineage-sdk: Remove single hand mode enum values
Change-Id: I2865d57d5b6e49391898e8de06889b1a26c54970
2021-05-04 11:15:06 +02:00
Bruno Martins
d1461d3451 BatteryLights: Fix disabled lights when fully charged conditions
Make sure that the option has effect ONLY when battery is uh...
fully charged.

Additionally add previously missing logging.

Change-Id: Ib232d0ea6652230a2435be6931f964dc04a30f71
2021-05-03 19:05:45 +01:00
Bruno Martins
c47d955826 BatteryLights: Add ability to turn off LED when fully charged
Change-Id: I01b8c753a1f92838462a797fd97b5f6a3c666158
2021-04-30 19:40:57 +02:00
Arian
5f3ded7d05 Introduce anti flicker mode in LiveDisplay
Change-Id: Iba7387ff16d463d087c9a38bced90b6c1bd503b1
2021-04-06 11:35:41 +02:00
Arian
056187e74f LineageHardwareManager: Introduce keys swap feature support
Change-Id: I789814d780b06b146c1f9ab62293f4d6ca287208
2021-01-07 17:24:01 +00:00
Michael W
54d862cac4 SystemUI: NetworkTraffic: Refactor message handling
* In certain network situations (e.g. while changing from wifi to
  cellular) it can happen, that the HashMap is modified while the stats
  are currently being recalculated
* We can prevent this by moving adding and removing of any network
  to the same handler so the callbacks can happen without breaking the
  flow
* Move the existing code in handleMessage into some little helper
  methods so it stays simple and readable

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/2870
Change-Id: I38c0c27a4f76fab5aeee013beab346c088bbbd59
2021-01-01 14:19:44 +01:00
Alessandro Astone
967b1a8b8f Profile: Don't NPE when service is not started
On FDE we check wether keyguard is enabled before starting non-core
services like ProfileManager.
All method calls are already guarding RemoteException for a binder
fail, so just throw one if getService() fails.

Change-Id: I44a3a5ea56a5277d84d96a0bc2c7135433811e20
2020-12-21 19:25:00 +01:00
Jesse Chan
e588c4aa83 Implement click to take partial screenshot [3/3]
Change-Id: I9de0cd4f1b793119a7dd45a95b040f70d6c151a6
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-11-11 00:10:00 +01:00
ezio84
f90b813374 LineageButtons: Add support for skipping tracks with remote control
For Spotify and other players that allow music controls for
remote devices (PC, PS4) through the media notification

Change-Id: I38887f8b1cff1a0c1e3adadbfe37d5af59b5cdcc
2020-11-09 11:03:21 +01:00
LuK1337
d8742f0727 sdk: Deprecate POWER_MENU_ACTIONS
Change-Id: I35b0d1123a427598e548cf865328a7c9423cbbca
2020-11-07 17:15:09 +01:00
Bruno Martins
88daa87a94 ConstraintsHelper: Allow replacing multiple keys at once
Change-Id: Ic676aaf12abd4d4b7a6a60b66308774a944ffdd8
2020-10-25 20:04:12 +02:00
Bruno Martins
7bf74325e4 sdk: Kill TelephonyExtUtils class
Since Android 10 arrived, the support for manual SIM provisioning
was never ported. In fact, there seems to be a way to do that
using some bits of AOSP code.

This way we get rid of the telephony-ext dependency for good.

Change-Id: Ibe4e430d696782032b7d9840ab36db040c3a4df9
2020-10-12 18:03:11 +02:00
Bruno Martins
af3c06c2b1 sdk: Mark ADB_NOTIFY and ADB_PORT settings as deprecated
Android 11 introduced Wireless Debugging, rendering our good old feature
redundant.

Change-Id: I7581fd79c5addad4542f392217365fa7e192528d
2020-10-12 18:01:36 +02:00
Bruno Martins
9eca90278d sdk: Remove "long-press back to kill app" feature
Change-Id: I3df4469beb53eeee070cdc486d02bb95001d7f53
2020-10-08 20:28:08 +01:00
LuK1337
1317cf2b12 LineageSettingsProvider: Make it compile again
* IContentProvider API now requires us to pass an attribution tag.

Change-Id: Ie991f71fb34717ab7d811ccb519a0d2d595df388
2020-09-15 10:11:35 +02:00
Jesse Chan
343d1e5f1d Implement quick QS brightness slider [3/3]
Change-Id: I00ad1ce2742faa1f5a24e4b4f034b314c61cbfd0
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-06-01 16:21:27 +02:00
Jesse Chan
d649b1d261 Implement hide gestural navigation hint bar [3/5]
Change-Id: Iaf776d9d70b951119134eb31bc44a3a63f468698
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-05-26 22:07:38 +02:00
Jesse Chan
9d01848dcd lineage-sdk: add black theme for dark mode [4/4]
Change-Id: I53bbb8b9115d5b523aebd09cdb550df577c27272
2020-05-26 19:23:23 +02:00
Joey
d07821003e sdk: add top exclusion to the back gesture
Change-Id: I908714d80740598188ef6a27f35e4f2cb228094a
Signed-off-by: Joey <joey@lineageos.org>
Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Signed-off-by: Jesse Chan <jc@lineageos.org>
2020-05-26 19:22:29 +02:00
Sam Mortimer
082c3c6b86 lineage-sdk: NetworkTraffic: Cleanup network callback
* Don't call ConnectionManager.get* methods from within the callback,
  docs say it's racy.

* Remove the NetworkState struct whilst we're here.  It was
  useful for debug during development but is no longer needed.

Change-Id: Ia1abbdfa31b258c38ba809844340d0dc06e5bd07
2020-05-04 10:22:48 +02:00
Linux4
1c3c0432d0 lineage-sdk: add powershare qs tile
Change-Id: Ia324041843b7314881d9958f81fdc45a92b56ea0
2020-05-01 17:00:54 +02:00
Michael W
373a11adfb Profiles: Work with a list of subscriptions
* This is a better approach to work with all subscriptions independently

Change-Id: Ibb8f8a2483bfc1e36dc27e5d6abaf9fc653fbeeb
2020-04-22 08:09:46 +02:00
rautamak
fdf30702a7 sdk: Allow translucent notifications background on lockscreen [2/3]
Change-Id: I5f2ee373e446713aee236540f8d16e2685227b32
2020-04-21 21:04:38 +02:00
Bruno Martins
b485a25aa3 profiles: Fix typo in static variable naming
Change-Id: Ic17febc55e6726f0efc18c201223856bbc2798b3
2020-04-21 11:53:28 +02:00
Bruno Martins
bd39ad8c07 profiles: Account for deprecated location API methods
Settings.Secure#setLocationProviderEnabled is deprecated since API level 19.

Change-Id: I7d1d13de3af100fb81d87e957acf89fb7f08cb7d
2020-04-21 00:47:55 +01:00
Andreas Schneider
f3b9b0c95d lineage-sdk: Add AoD Tile
Change-Id: I9ab3f3269849edd6052be644f551ec2658615423
2020-04-04 19:00:36 +02:00
Sam Mortimer
f12a1e5568 NetworkTraffic: Include tethering hw offload statistics
*) Regular interface stats don't include hw offload tethering
   statistics so collect and include them in our traffic
   calculations.

Change-Id: Id72577429840f65ae20d7b80e7490ec41d826579
2020-03-17 21:23:00 +02:00
Nico
c3b5589ccf Implement edge long swipe gesture [2/3]
Set up standard action setting for long swipe gesture.
(KEY_EDGE_LONG_SWIPE_ACTION)

Change-Id: Ida75e768b822542dea944cc719408e192bbb7d7e
2020-03-15 11:48:18 +01:00
Wang Han
06ecc3c168 lineage-sdk: Drop Expanded Desktop API
* This conflicts with AOSP gestures implemention now, and
   the framework part is hard to port.
 * Furthermore the original implementation has the following
   bugs/issues:
   1. Pressing power button or double tap does not wake up the device
   2. No soft-key buttons when opening the keyboard
   3. Probably more

Change-Id: Ia233c3b9d0aa7426f0fd15dffe4da203b4e09b1d
2020-03-09 15:36:50 +01:00
Michael Bestas
f355fdbfe8 sdk: Remove berry style leftovers
Change-Id: I59cf25452d1de34bc3c357cdc01b6a4f985802ad
2019-12-16 15:10:11 +01:00
Wang Han
d0702b1288 lineage-sdk: Drop root status of Trust
Change-Id: Iaec0b2a8a781a0e9d301a21a3af5e4362a5d6630
2019-12-08 23:04:18 +01:00
LuK1337
7f4f356c67 sdk: Add GLOBAL_ACTION_KEY_RESTART_FASTBOOT
Change-Id: Ib4f050f634769f58e654a4240fb521f136fd04e7
2019-12-08 20:23:40 +01:00
Michael W
8505f77f36 sdk: Make phone a new compile target
* Moving SensitivePhoneNumbers to sdk got us significantly bigger
  zip packages due to libphonenumber being part of every package that is
  using org.lineageos.platform or org.lineageos.platform.internal
* In order to correct this, move the "phone" folder to an own library that
  statically links libphonennumber and subsequentially make use of that
  package where needed

Change-Id: I4effd7a9248290aeb23ab47ff8e30385dce4401a
2019-11-23 13:10:42 +00:00
Bruno Martins
4eeac2c95b sdk: Nuke Berry Styles
This is being ditched in favour of ThemePicker.

Change-Id: I00c5faca452164d59b804cb64166edb83611f77d
2019-11-21 02:36:13 +02:00
Bruno Martins
6cd66659a2 sdk: Mark PG settings as deprecated and remove related resources
Change-Id: Ie2867e46e20ff8749ca4755f7ead847c7962b583
2019-11-04 14:30:37 +02:00
Michael W
ba27ffbbe0 SensitivePhoneNumbers: Load numbers only at first actual call to method
* Constructor is called during boot, adding boot time where
  it's not necessary
* Use the first actual call to a function to parse the list

Change-Id: I02548d004c5d78db65c872247cd36a0405d826ea
2019-11-02 19:08:11 +01:00
Michael W
1498ef9052 SensitivePhoneNumbers: Convert to singleton class
* Now that there are more users than just call log, it is better to parse
  the XML-file just once
* Keep an instance around for the various users of this class

Change-Id: Iff1510dc40d68a211a6a1c5f19e4ca9ac64c3fcd
2019-11-02 19:07:14 +01:00
Michael W
bf0d04e4de SensitivePn: Also hide international numbers
* When calling the number with intl. prefix it is currently not hidden
* Remove the international prefix before checking th number

Test:
Before:
116006 - hidden
+49116006 - not hidden
004911606 - not hidden

After:
116006 - hidden
+49116006 - hidden
0049116006 - hidden

Change-Id: I72ec2c9a4da87ef243c59c8c4bab33585fdbd854
2019-11-02 19:04:28 +01:00
Michael W
b5462e3657 SensitivePn: Take into account multiple SIMs for sensitive numbers
* Instead of only checking the current or default MCC to hide a number,
  see if any of the connected networks would hide a number
* This makes sure that e.g. for multiple sims (e.g. living next to the
  country border, having one sim for each country) and accidentially using
  the wrong sim for a call, the number would still get hidden

Change-Id: I2692d00217d3143fd55122cee9064528bb09352d
2019-11-02 19:04:28 +01:00
Olaia Segovia
f4e2968123 sdk: Import SensitivePhoneNumbers
* In order to access the classes in Dialer, we need to expose them

This was extracted from the original implementation in Telecom

Author: Olaia Segovia <olaia.segovia@bq.com>
Date:   Thu Mar 16 08:40:30 2017 +0100

    (1/2) Make sensitive phone numbers not to be shown in call log history.

    Considering sensitive phone numbers to be, hotlines dealing with
    violence against women.
    In the EU, these numbers do not show up in the phone bill.
    In order to avoid these phone numbers to be listed in the Call Log, we
    have implemented a new XML file which is parsed with phone numbers
    from different countries to be filtered. This file needs to be copied to
    device via desired Android.mk file in order to be able to process it.
    The comparison is made checking the network MCC the SIM is connected to
    in order to consider roaming and multisim scenarios.

    Test: CallLogManagerTest.testDontLogCallsToSensitivePhoneNumber PASS

    Change-Id: I4a59ff0577942ce56924f1a434ae0a3a38eacc62
    Signed-off-by: Olaia Segovia <olaia.segovia@bq.com>

Author: Paul Keith <javelinanddart@gmail.com>
Date:   Thu Jun 22 19:40:56 2017 +0200

    SensitivePhoneNumbers: Handle lists of MCC codes

    * Some countries have multiple MCC codes, so handle it
    * In the sensitivePN network field, enter the list of
      MCCs like so: https://review.lineageos.org/178233

    Change-Id: I34225473404b2be2640ea9ab05691dc985c49fa0

Author: Paul Keith <javelinanddart@gmail.com>
Date:   Thu Jul 6 16:12:12 2017 -0500

    SensitivePhoneNumbers: Fix number comparison

    * Currently, we just compare the strings for equality,
      which results in incorrect detection of sensitive nums
      a lot of the time, because adding (or removing) the
      country code is enough to make the detection fail,
      meaning the call to that phone number is logged
    * Use Android's PhoneNumberUtils comparison method to
      fix this, since it takes these factors into account

    Change-Id: I26ac180f8a6552cf87a4bada1d370f0ebb884ee1

Author:     Michael W <baddaemon87@gmail.com>
AuthorDate: 2019-09-07 18:34:57 +0200

    CallLog: Fix improper call to SensitivePhoneNumbers

    * isSensitiveNumber expects a subId to be passed, but with the current
      implementation gets a PhoneAccountHandle
    * Actually pass the subId and make the call use an int, while on it
    * Fall back to the default subId only when we get an
      INVALID_SUBSCRIPTION_ID

    Change-Id: Id6d64f2c9f76d94d1b4d9851317ea2cc7e07323b

Change-Id: I241c1652105b82d1d15549332cb6e274d7c726ce
2019-11-02 19:04:25 +01:00
Sam Mortimer
3d25e8b3f7 lineage-sdk: Fix LineageSettingsProvider tests
* Fix bp and manifest to work with AndroidJUnitRunner.

* Remove broken tests (we no longer intercept in fw/b
  settings provider and QS_USE_MAIN_TILES was removed).

* Tests pass when executed using:
  adb shell am instrument org.lineageos.lineagesettings.tests/androidx.test.runner.AndroidJUnitRunner
  (see README.md for more info)

Change-Id: I3fcf4885c61106f43e99847293220afee78e2f6a
2019-09-20 16:44:37 -07:00
Sam Mortimer
7e03d078bc lineage-sdk: Add call methods for list and delete to our settings provider
To match changes in fw/b settings provider

Change-Id: Ie4683fe29b9109091d0ebd4910d31b7b4c714daa
2019-09-19 22:08:52 -07:00