Commit Graph

971 Commits

Author SHA1 Message Date
Sam Mortimer
507605002f lineage-sdk: Bump PREF_HAS_MIGRATED_LINEAGE_SETTINGS for 17.0
Change-Id: Ia88d36533c0b0a2dd8ca18e93de5d03441dd8092
2019-11-15 00:24:18 +01: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
LuK1337
e530d7a126 lineage-sdk: Clean up imports
Change-Id: Ie14853382ebefd42fdf827e2999a2a2a6d0a1cd1
2019-09-10 16:10:48 -07:00
Sam Mortimer
29e2f6b35a lineage-sdk: Don't build sdk droiddocs for now
* Works around:
  lineage-sdk/Android.mk:116: error: BUILD_DROIDDOC is obsolete. Droiddoc is only supported
  in Soong. See details on build/soong/java/droiddoc.go.

* Need to reimplement in soong later.

Change-Id: I1a3756b4e4779dc27fe52ed31d767ca660756298
2019-09-10 15:55:55 -07:00
LuK1337
b7fc0cfb4c lineage-sdk: Remove leftover lineagehw compat code
Change-Id: I6a400cc79b9d00553c6646b788f9a4aa959a91b5
2019-09-10 15:27:52 -07:00
Sam Mortimer
3a06cbea25 lineage-sdk: Include authority in content provider calls
API changed here:
633a13e2fa (diff-944e798f679ef205433bd711345d06dcR75)

Fixes:
AndroidRuntime: Caused by: java.lang.SecurityException: The authority
unknown does not match the one of the contentProvider: lineagesettings

Change-Id: I5fe85fee777f919824e6a2ff78986e2d736e0267
2019-09-09 07:37:31 +02:00
LuK1337
85463dfa67 lineage-sdk: Mark org.lineageos.platform as installable
Change-Id: I482db1811f9e7f1fb499d70f3e6fdd6bfc19d7b7
2019-09-09 07:37:10 +02:00
LuK1337
2cb9a5d2d0 lineage-sdk: Link to vendor.lineage.trust-V1.0-java
Change-Id: Ie1a9117b8d46a3e44f05e5be8497860ebb6a2733
2019-09-09 07:36:55 +02:00
LuK1337
e8a2616923 lineage-sdk: ServiceType.GPS -> ServiceType.LOCATION
Change-Id: I2823b5d987f4be069ff9247f32c2f2632e03bd44
2019-09-09 07:36:36 +02:00
LuK1337
f2eb49a686 lineage-sdk: Update DisplayTransformManager class path
Change-Id: I5501f6201714333ca07a837e79ab39d1d9372f5b
2019-09-09 07:36:13 +02:00
LuK1337
2976ea9c7b lineage-sdk: Switch to ColorDisplayManager
* ColorDisplayController is dead

Change-Id: I9b5fdc3546bea7aabd65877c1862d9eaebbd4af3
2019-09-09 07:35:36 +02:00
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
e8814c5f0b lineage-sdk: Run bpfix on our Android.bp files
In particular, fixes packages/LineageSettingsProvider/tests/Android.bp
which otherwise results in errors about unknown properties tags
and instrumentation_for.

Change-Id: I1d44fce77765a77ed6f3c23763f439a216eaefda
2019-09-09 07:32: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
Michael Bestas
9b69fd9c0c Automatic translation import
Change-Id: Iaab92105e9b37bcf015ba07362cc6fbd14047d8a
2019-08-25 20:36:37 +02:00
Joey
1be72e7e3d sdk: tests: fix LineageHardwareTest
Change-Id: I7fb99b8e92e83f6288e90e3dad9748b2eaf6305a
Signed-off-by: Joey <joey@lineageos.org>
2019-08-24 22:04:42 +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
dianlujitao
36a87acd92 OutdoorModeController: Unconditionally enable auto mode on HWC2
* On HWC2, setting "Display mode" to "Automatic" and disabling
   "Automatic outdoor mode" at the same time makes no difference with
   setting "Display mode" to "Off" alone. Obviously this is redundant
   and could confuse the user, so simply ignore the "Automatic outdoor
   mode" setting on HWC2 to reduce redundancy.

Change-Id: I6858571a6b9ded3540fd3d936499878f57a7b3d4
2019-08-20 17:17:28 +02:00
dianlujitao
73fdcd14ac OutdoorModeController: Advertise MODE_AUTO
* This capability is set by ColorTemperatureController on HWC1 which is
   not used on HWC2, but it controls whether to enable automatic outdoor
   mode, thus advertise it here.
 * Set the default mode back to MODE_AUTO.

Change-Id: I2061cdb9ca5991e60dc9c4b3d566dd811c3c8936
2019-08-20 17:17:28 +02:00
dianlujitao
0f5f0e25ca LiveDisplayService: Properly disable ColorTemperature
This reverts commit f781a9399a.

 * Twilight tracker and display mode are still used by
   ColorTemperatureController

Change-Id: Icaf2a93befd56478eb2307d6f25da49c7c3fd73f
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
Michael Bestas
2250c78241 lineage-sdk: Correct default value of charging sounds
* It is enabled by default on Pie

Change-Id: Ia6faeee4d41c088d057fe1719f32d70f7fa1b099
2019-08-19 18:33:07 +02:00
Martincz Gao
92bd1871b6 lineage-sdk: Use AOSP default ringtone for power notification
Change-Id: I5b9aa82f23d404ea4372658671608b106600733f
2019-08-19 18:32:55 +02:00
Michael Bestas
10e0e87158 Automatic translation import
Change-Id: I0aeca2cb7c42a517b92b6d6cae3856572b210a63
2019-08-04 16:22:27 +03:00
Michael Bestas
6068c7d3a4 Automatic translation import
Change-Id: Ic88e1f4ea4e44cfdd74ffb9f0e0c8cb678a09b5b
2019-07-06 11:57:32 +03:00
Michael W
9a2567bf78 Trust: Onboarding: Listen for locale changes
* When SuW is not yet done, the notification is already posted
* This results in an english notification text when the SuW is finished
  because the notification doesn't update when the locale changes
-> Listen for locale changes and post the notification again (= update)

Change-Id: I920a52c5c85c91adb7333a20d410a5464e80a812
2019-06-26 23:20:52 +02:00
Michael Bestas
f3b2904187 Automatic translation import
Change-Id: Idf93ba1c852729a0f138d2ce8c41bf5027db5cfc
2019-06-19 21:19:55 +03:00
Sam Mortimer
eaedf7be02 sdk: Add volume panel left/right setting
Change-Id: I378e07bbed1fa438323be1ceaaeb6f9189daea45
2019-06-09 21:02:51 +02:00
Michael Bestas
1c52f374a4 Automatic translation import
Change-Id: I2d6ab8ea3d829b91c1d147f2efe9249f7a6cd04b
2019-06-08 18:56:59 +03:00
Bruno Martins
f781a9399a LiveDisplayService: Disable ColorTemperature when NightDisplay is available
* Having decided to use AOSP's night display feature in favor
   of our equivalent implementation, then we should take care of getting
   the latter completely disabled. Not only it can happen that a user was
   likely using it and enabling night display will now cause color
   transformation matrices to be applied twice, but also because there
   are resources being used for nothing.

Change-Id: I4ba7f643bf9e3d3b9bda17102b41668644e22ba1
2019-06-05 00:50:11 +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
Paul Keith
70f6d6b61e sdk: Change night/day mode transition behavior
* Update 2x a minute rather than 1x a minute as a result of dropping
  TWILIGHT_ADJUSTMENT_TIME from 1hr to 30min in an earlier change
* Use an AccelerateDecelerateInterpolator for transitioning from day
  to night mode and back to make the transition smoother for the user
* Update copyright while we're at it

Change-Id: I438f265c6cd9a2487b75744beccaf2bbac21b36e
2019-05-14 04:12:54 +02: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
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