Commit Graph

857 Commits

Author SHA1 Message Date
Quang Luong
72c56e2c88 Merge "Fix NPE on getTitle()" into qt-dev am: afee5a7219
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15888886

Change-Id: Ib57e720c6c28fe5d24406775ba8832650c8dbd12
2021-09-30 15:23:33 +00:00
cnchen
ced3af1e05 Fix NPE on getTitle()
Bug: 199922685
Test: make RunSettingsLibRoboTests -j40
Change-Id: I35bf6f5911dc0ee56e43af7faddaceb479362863
(cherry picked from commit f00f2203b5)
Merged-In: I35bf6f5911dc0ee56e43af7faddaceb479362863
2021-09-22 22:20:42 +00:00
Raff Tsai
8ef5d5e438 Fix Battery optimization takes long time
isDefaultActiveApp is called on every package. We can cache default
dialer and default sms package in a list, and check if the list
contains target package name.

Fixes: 140279638
Bug: 151233929
Test: manual, make RunSettingsLibRoboTests
Change-Id: I81f5ccb7aed1ebec797a21af6094971e05f456a7
(cherry picked from commit 19c2bbccfd)
2020-03-30 06:15:28 +00:00
Arc Wang
6e810df9b8 [Wi-Fi] Fix transition mode problems
1. In AccessPoint#updateBestRssiInfo, if bestResult is available, cache if it’s transition mode at  new variables.
2. Remove SECURITY_PSK_SAE_TRANSITION & SECURITY_OWE_TRANSITION since we will cache if an Wi-Fi AP is transition mode.
3. Enhance getSecurity(ScanResult result).
   For a PSK/SAE transition mode ScanResult, return SAE.
   For a open/OWE transition mode ScanResult, return OWE.
4. Enhance all AccessPoint#matches methods
5. Use enhanced AccessPoint#matches to replace AccessPoint#isKeyEqual
6. In WifiTracker#updateAccessPoints, it associates an AccessPoint with a configured WifiConfiguration
   I. If an AccessPoint is PSK/SAE transition mode, update it with a configured network
      of the same SSID and PSK/SAE security if it’s available. (SAE has higher priority).
   II. If an AccessPoint is Open/OWE transition mode, update it with a configured network
       of the same SSID and open/OWE security if it’s available. (OWE has higher priority).

Bug: 144320676
Bug: 144320649
Bug: 144325162
Bug: 144321574
Test: atest SettingsLibTests
      manual: In Wi-Fi picker
              1. Save a PSK network, click a PSK/SAE transition mode AP of the same SSID,
	         it should connects.
              2. Save a SAE network, click a PSK/SAE transition mode AP of the same SSID,
	         it should connects.
              3. For 1. and 2., the transition mode AP should show 'Saved'.
	      4. For 1. and 2., looking at saved network page, each saved network should
	         shows correct connection status of the transition mode AP.

Change-Id: Ida858af791bc60f0ccb11025901de2a79eacba3c
Merged-In: I9688f51f4a4b8e3d5c080fb0d0103abb4e3fd79b
2019-12-09 19:17:23 +08:00
Jason Chiu
cf1517cfcc Fix Settings creating too many threads unexpectedly
Provide a method to submit a Callable for execution in the shared
background thread pool.

Bug: 143434413
Test: manual, robotest
Change-Id: I149b5926f20acd0e43c4071cc35520c6bc50efef
Merged-In: I149b5926f20acd0e43c4071cc35520c6bc50efef
(cherry picked from commit ab21b8a838)
2019-11-12 16:32:01 +08:00
Malcolm Chen
ac56a4254e Provide @hide API to return merged IMSIs from grouping.
Bug: 135105735
Test: test app. Apply grouping and call the new API, to make sure
it returns correct values.

Change-Id: I99586976d3421d4b35be465201ee33cbb2dfd1d9
2019-07-11 13:19:36 -07:00
Lei Yu
68178f853b Merge "Use old API to build NetworkTemplate" into qt-dev
am: e5fdc968a0

Change-Id: I35702ae50d5274defd6974245bf1209ad3a0115f
2019-07-10 11:07:38 -07:00
Lei Yu
5e955861f9 Use old API to build NetworkTemplate
Use old API to be consistent with NetworkPolicyManagerService

Bug: 135105735
Test: RunSettingsLibRoboTests & Manual test
Change-Id: I5d04cfd962c3d09cac7d33a97f847771074ab258
2019-07-09 17:18:49 -07:00
Beverly
5090f7da48 Log Preference changes when value is a String
As long as the String can be converted to an integer

Test: atest SharedPreferenceLoggerTest
Fixes: 135937584
Change-Id: If58077c9c7b10373c4c2459d275add25a5bcdc05
2019-06-24 16:41:37 -04:00
Lei Yu
2a31c40e45 Use new API to build NetworkTemplate
This CL is built to make CBRS show correct data usage, by merging
all subscriberId under same groupuuid

Bug: 133865338
Test: RunSettingsLibRoboTests
Change-Id: I1c5084ff98ac9a71655cc93698f3e02268654977
2019-05-31 13:40:54 -07:00
Philip P. Moltmann
4f09b09f62 Merge "Whitelist all perms on installExistingPackage" into qt-dev 2019-05-17 19:56:19 +00:00
Lei Yu
b899f8abdd Merge "Add short version bluetooth device summary" into qt-dev 2019-05-16 18:18:45 +00:00
Philip P. Moltmann
a4bd150588 Whitelist all perms on installExistingPackage
The code allows to also whitelist only a select set of permissions, but
this is not yet exposed in the API.

Also: Fix up shell commands for restricted permissions

Fixes: 132368462
Test: - Enabled app via device admin in secondary profile
        -> verified that permissions were whitelisted
      - Installed existing and new app using --restrictpermissions and
        not
	-> verified that permissions were whitelisted or not
      atest AppRestrictionsHelperTest
            RestrictedPermissionsTest
Change-Id: I9cd76c555b40663f2e25ad86e8a54991baae346c
Merged-In: I9787e63d8beb8f6b1ba2d15532d4c0f69dbdf863
2019-05-15 11:09:45 -07:00
Lei Yu
35fcd6b0e3 Merge "Use merged NetworkTemplate to query data usage" into qt-dev 2019-05-15 00:27:23 +00:00
TreeHugger Robot
9a78a2a88c Merge "Add a parameter to filter out system apps" into qt-dev 2019-05-14 00:07:28 +00:00
Lei Yu
e63ca1b857 Add short version bluetooth device summary
Bug: 132640667
Test: RunSettingsLibRoboTests
Change-Id: I38e7eb486238637bdacfaf6b1140f1a24b71a066
2019-05-13 16:17:29 -07:00
Lei Yu
c00a30eb8a Use merged NetworkTemplate to query data usage
This CL uses merged NetworkTemplate so that it shows correct
data for carrier which is a virtual that has multiple
subscriberId under the hood.

By doing this, this CL also adds several hidden API so settings
can query by NetworkTemplate directly.

Fixes: 120566366
Test: RunSettingsLibRoboTests
Change-Id: I8b747697933c75b48b14387adafb5ac9ca165926
2019-05-13 11:42:23 -07:00
TreeHugger Robot
ec14f42bd7 Merge "Notify UI update when get onAudioModeChanged() callback" into qt-dev 2019-05-10 18:14:02 +00:00
hughchen
db335faae8 Notify UI update when get onAudioModeChanged() callback
- Update test case

Bug: 132385707
Test: make -j42 RunSettingsLibRoboTests

Change-Id: I96043e2cf5411745483db00bb2bba982e68558ce
2019-05-10 10:15:31 +08:00
Xiangyu/Malcolm Chen
c2d6cf12a2 Merge "Mobile data in quick setting still work if default data not set" into qt-dev 2019-05-10 01:57:10 +00:00
Malcolm Chen
a1a7f192f9 Mobile data in quick setting still work if default data not set
Even if default data subscription is not set, we'll make "Mobile data"
toggle in quick setting work. It will find an active subscription, turn
on its mobile data, which implicitly makes it default data sub.

Bug: 132063538
Test: robo test and manual

Change-Id: I05263ca6e7e0f9171c6d34c7b628553b9ec506ab
2019-05-09 14:54:45 -07:00
Lifu Tang
b131757938 Add a parameter to filter out system apps
Bug: 124015107
Test: build, flash, and test manually
Change-Id: Id1dd5926b77b1b2ae68220f90af8aab6be8dc408
2019-05-07 17:53:28 -07:00
Daniel Nishi
02917dd5f7 Remove the cache size from internal size.
Because the system can automatically clear away cache data, we remove
usage of it from the list of app storage usage in Settings. This should
encourage developers to more aggressively use the unattributed cache,
rather than the attributed regular data folder.

This affects the following fields on the AppEntry: internalSize & str
and size & sizeStr (which are derived from the internal size).

Currently, ApplicationsState.AppEntry.internalSize, externalSize, and
size are only used in the Settings apps so this shouldn't have broader
implications.

Test: Manual verification of Other Apps page
Fixes: 131152171
Change-Id: I3eb2e28701490a543c633e9c95a280059bb99c21
2019-05-07 15:18:10 -07:00
Quang Luong
d20d4b1d65 Merge "Update Passpoint R1 AccessPoint with R2 config" into qt-dev 2019-05-03 21:31:30 +00:00
Quang Luong
e747f59665 Update Passpoint R1 AccessPoint with R2 config
Made sure to update the WifiConfiguration of a Passpoint AccessPoint
to update the friendly name if a user installs an R2 config over an
R1 config.

Bug: 131840803
Test: atest WifiTrackerTest
Change-Id: I39cd5679b65240dabee0f67df866e34d1700c769
2019-05-02 11:43:06 -07:00
TreeHugger Robot
781ebfb059 Merge "Catch NPE and add more logging for a crash in Tile" into qt-dev 2019-05-01 20:38:37 +00:00
Fan Zhang
5efaa86a8d Catch NPE and add more logging for a crash in Tile
Fixes: 131648303
Test: robotests
Change-Id: I879aad929b9620607612eb3456545ac2a8050ccc
2019-04-30 13:34:04 -07:00
clownshen
78be6541d6 Provide "Disconnected" in summary for detail page
Wi-Fi detail page need to use "Disconnected" instead of "Saved" to
improve UX.

Bug: 131119614
Test: atest AccessPointTest
Test: manual test
Change-Id: I8e1cec3c64a3118f6a7448b7ec233cd4d9a92942
2019-04-25 06:07:13 +00:00
Tarandeep Singh
3daa9f56b5 Fix: Allow system IME to be disabled when another IME is available
In P, pre-installed system IME could be disabled if an ASCII non-aux IME
was available. With I1352bf42dcb9219a370a16a381ea39c43c57637a,
system-IMEs could no longer be disabled. This was unintentional as the
method name isValidSystemNonAuxAsciiCapableIme was incorrect and it
wasn't checking isSystem() earlier.

This change renames it to isValidNonAuxAsciiCapableIme and removes the
system check in order to revert to original P behavior.

Change-Id: If40de88ca0536a4446135047b6ccab64681675ec
Fix: 124536147
Test: atest InputMethodPreferenceTest
Test: atest InputMethodAndSubtypeUtilTest
Test: Manually verified using steps in bug.
2019-04-17 16:20:12 -07:00
Daisuke Niwa
fc63619d49 Avoid NPE when accessing to EnforcedAdmin
NPE happens when "modify" is tapped on the carrier wifi network
connected using CarrierConfig information. null is passed to
sendShowAdminSupportDetailsIntent method through 2nd argument.

Bug: 128188146
Test: Manually verified the crash scenario
Test: RunSettingsLibRoboTests
Signed-off-by: Daichi Ueura <daichi.ueura@sony.com>
(Cherry-pick from pa/1302748)
Change-Id: If92c12041b91dbab0f083a1b49d263b201e87699
2019-04-15 13:09:58 -07:00
Ying Zheng
6e54927990 Remove the deprecated UserManagerHelper, new one is in car user lib.
Test: build
Bug: 130313554
Change-Id: Iee5282a9a40935c43dc1b4cb7814a67ac4324d7c
2019-04-11 10:20:34 -07:00
Ugo Yu
73c387d950 Bluetooth metadata API changes in SettingsLib
* Align with the changes of Bluetooth metadata API.
* Move metadata utils from Settings to SettingsLib.

Bug: 124448651
Test: make -j56 RunSettingsLibRoboTests
Change-Id: I431e7bcbd8123eacf0ed3b5ba87af6cc54670481
2019-04-09 11:49:32 +08:00
TreeHugger Robot
0e7083bcf3 Merge "Refactor PowerWhitelistBackend" 2019-04-03 20:41:21 +00:00
lindatseng
fff2b19e56 Fix tinting on injected pref icon in Tile
We used to tint the icon when refreshing Tile.  However, when we getIcon
from Tile, we get the icon directly from the icon resource but not the
copy of the tinted icon.  The tinting was not honored in this case.

Do a little refactor in this cl to tint the icon in Tile.getIcon
instead.

Test: Manual/Visual inspection, robotests
Fixes: 129010399
Change-Id: I88c9b00046534d8b9ddedce9009a6e340d42fca6
2019-04-02 16:29:04 -07:00
jackqdyulei
aaabf2b44d Refactor PowerWhitelistBackend
Extract method to check default active apps

Fixes: 118910079
Test: RunSettingsLibRoboTests
Change-Id: I7ff771d23d83d21e041a208619bbec885039c7a5
2019-04-02 14:48:08 -07:00
Quang Luong
089c54316b Merge "Connect to Passpoint network immediately after OSU provisioning" 2019-04-01 17:55:36 +00:00
TreeHugger Robot
439c06ba28 Merge changes from topics "apply_fast_pair_icon", "bt_color_icon"
* changes:
  According Bluetooth device type to get icon
  Add method to get rainbow bt icon
  Separate library from SettingsLib
2019-03-31 07:03:03 +00:00
Quang Luong
85bbc6e0a0 Increase ScanResult cache eviction timeout for failed/aborted scans
Currently ScanResults are evicted from WifiTracker's cache when they
are more than 15 seconds old. Since scans are conducted every 10
seconds, one aborted scan will cause no fresh scans to be seen until
20 seconds later, resulting in all scans to be evicted and the
wifi-picker completely emptying.

This change doubles the eviction timeout to 30 seconds if the last
scan was aborted, avoiding this case.

Bug: 113132408
Test: atest WifiTrackerTest
Change-Id: I2e3aad3a1470f52c3d87e657262a2c4de1bd2418
2019-03-29 11:19:59 -07:00
hughchen
678f4fc1c7 Add method to get rainbow bt icon
- Add method to get rainbow bt icon
- Add fast pair icon with background shape

Bug: 128570540
Test: RunSettingsLibRoboTests
Change-Id: Idf97d3c1fd892d9b3188b61be47d190ac2075af9
2019-03-29 11:29:04 +08:00
hughchen
ed6a4d2829 Separate library from SettingsLib
Separated library for following class:
- AdaptiveIcon.java
- AdaptiveIconShapeDrawable.java
- AdaptiveOutlineDrawable.java
- TileUtils.java
- DashboardCategory.java
- Tile.java

Bug: 128570540
Test: RunSettingsLibRoboTests
Change-Id: I616e68f6e5ac9afee805793e80374aabebc69ccb
2019-03-29 11:29:04 +08:00
Quang Luong
7cfa527511 Connect to Passpoint network immediately after OSU provisioning
Added logic in the OSU provisioning callback to connect to a
network immediately after provisioning is complete.

Bug: 123697580
Test: atest AccessPointTest
Change-Id: I39d1ec9726d6211ebd385931e19322bde58baafa
2019-03-28 12:39:32 -07:00
TreeHugger Robot
cd62e44210 Merge "Ignore some test cases in RecentLocationAccessesTest" 2019-03-27 21:02:07 +00:00
tmfang
b99fefdd4f Ignore some test cases in RecentLocationAccessesTest
Bug: 129390255
Test: robotest
Change-Id: I8b42675118de775ae9522ec90ae6c7701ba4112c
2019-03-27 19:49:10 +08:00
Joel Galenson
6486605525 Modify the bar chart for new graph design
- Allow passing a custom string as the label for each bar.
- Also allow passing a CharSequence as the bar summary instead of a
resource id.
- Change barchar style for new graph design. ex: color, font size,
margin size

Test: View graph.
Test: atest BarChartInfoTest BarChartPreferenceTest
Change-Id: I6f31ece4fe61811420cf2458219452862e8d04c2
2019-03-27 11:51:35 +08:00
TreeHugger Robot
18fb6cdb5f Merge "Fix UI incorrect when switch active device to hearing aid" 2019-03-25 12:02:27 +00:00
Fan Zhang
dc6c7db513 Merge "Make AppPreference summary and appendix stack vertically" 2019-03-21 23:41:58 +00:00
hughchen
2a3151d268 Fix UI incorrect when switch active device to hearing aid
When active device change to Hearing Aid,
BluetoothEventManager also send onActiveDeviceChanged() to notify
that active device of A2DP profile is null. To handle this case,
check hearing aid device is active device or not. If Hearing aid
device is active device then return Hearing aid device id,
otherwise return phone device id.

Bug: 128956186
Test: RunSettingsLibRoboTests
Change-Id: I1ba9249d7a7f634b56df019450643cfe147a5fb8
2019-03-21 12:04:31 +08:00
TreeHugger Robot
9ad5ddfc33 Merge "Remove battery icon from BT combined icon" 2019-03-20 18:51:28 +00:00
Lei Yu
cc843f3edb Merge "Update BT summary for tws device" 2019-03-20 01:26:43 +00:00
jackqdyulei
3bdd00b1b1 Remove battery icon from BT combined icon
Bug: 126425211
Test: RunSettingsLibTests
Change-Id: Iea7620088e1335d5486de77cb25b6da5c6de4c3b
2019-03-19 10:17:02 -07:00