Commit Graph

6994 Commits

Author SHA1 Message Date
Doris Ling
ce5f9c07da Fix new account not shown for work profile.
When refreshing the Accounts settings UI, we uses the cached user info
for checking user status. However, when the work profile is being
updated, the UserInfo obejct for the user might be updated even the
user id is the same. Using the cached data causes stale info to be
returned for the user and results in the latest account data not
being shown properly for the user. Update the cache to the latest user
info retrieved from user manager.

Change-Id: Ic0127842203f0288f2fdea6c6346cd11e42a8bf0
Fix: 38302246
Test: make RunSettingsRoboTests
2018-07-23 16:13:39 -07:00
Fan Zhang
75bafefa49 Move CategoryManager to Settings.
Bug: 77600770
Test: robo
Change-Id: Id4a0c89938d43d21147944b820a191486c589238
2018-07-23 15:09:41 -07:00
TreeHugger Robot
167b232242 Merge "Hide lock screen display in search if it's not in Settings" 2018-07-20 23:10:28 +00:00
Doris Ling
c24865e242 Merge "Fix battery animation not being played." 2018-07-20 22:28:53 +00:00
Fan Zhang
44acde5ee1 Hide lock screen display in search if it's not in Settings
Change-Id: Iacf16eb947a679e08a6c55e0764416cd53cac2e7
Fixes: 111641373
Test: robotests
2018-07-20 14:50:02 -07:00
Doris Ling
09f527d053 Fix battery animation not being played.
- VideoPreference now checks the view visible flag to see if it
should start playing the video when the surface texture is being
updated. Added a default controller for the VideoPreference to
update the view visible flag of the VideoPrefernece when the
setting page is paused/resumed accordingly.
- add the default controller to the adaptive battery video and the
adaptive brightness video.

Change-Id: I1aae2148c27c7157c97541346790542c74377e5a
Fixes: 111103815
Test: make RunSettingsRoboTests
2018-07-20 14:10:25 -07:00
tmfang
5bd7151413 Migrate all AlertDialogs to AndroidX version
- Let test cases can be compatible with AndroidX AlertDialog.
- Theme of Transparent needs to support AndroidX AlertDialog.

Change-Id: I0789b66f52feef30ebab7fb824d0e39d5ae9cc96
Fixes: 111413092
Test: make RunSettingsRoboTests -j56
2018-07-20 13:38:58 +08:00
TreeHugger Robot
6cf7a6e564 Merge "Move logic from SavedAccessPoint fragment to controller" 2018-07-19 23:07:09 +00:00
Fan Zhang
2ff710a911 Move logic from SavedAccessPoint fragment to controller
Change-Id: Ic54e536f97490cec1746fa58c42ec55b60d17f0e
Fixes: 64806699
Test: robotests
2018-07-19 14:49:14 -07:00
TreeHugger Robot
f8d595db54 Merge "Fix cached app icon being used in app list." 2018-07-19 21:16:34 +00:00
Doris Ling
8a5472f516 Fix cached app icon being used in app list.
- change to use the icon from IconDrawableFactory instead of from app
info when building the application list.

Fixes: 63978676
Test: manual, reinstall an app with updated icon and launch
settings->Apps & notifications->See all apps and check the app icon.

Change-Id: I99028ef97fb4fec8c90708b26caaddb7325c1ddb
2018-07-19 12:50:36 -07:00
TreeHugger Robot
295980fbb5 Merge "Use SettingsRobolectricTestRunner in settings app" 2018-07-19 19:25:49 +00:00
TreeHugger Robot
39bb6cec3e Merge "Make app predicates singleton" 2018-07-19 18:50:36 +00:00
jackqdyulei
63a5c6f9ab Use SettingsRobolectricTestRunner in settings app
Change-Id: I3682ea52c53ff4fcce7e9aa52a4a6827bb31b2cb
Fixes: 111646366
Test: robotest
2018-07-19 11:21:20 -07:00
jackqdyulei
341ad63da7 Make app predicates singleton
1. AppLabelPredicate
2. AppRestrictionPredicate

Change-Id: I1fd8611c5dd7ffa6318bcb23de7a973c111910b6
Fixes: 111323520
Test: RunSettingsRoboTests
2018-07-19 10:51:42 -07:00
TreeHugger Robot
e64020540c Merge "Fix a test broken by fragment migration." 2018-07-19 17:44:48 +00:00
Lei Yu
499f71988f Merge "Hook up anomaly active hour to BatteryTipPolicy" 2018-07-19 17:14:45 +00:00
Aarthi Balachander
d779db4009 Move functions to settingslib for more code reuse
Bug: 110376110
Test: Tested on device
Change-Id: I2bbb8d01f675fc254e783b97b44d16f36846a416
2018-07-18 20:05:24 -07:00
TreeHugger Robot
ec7a9df676 Merge "Use the migrated injected setting code in settingslib. Manual merge to master from pi-car-dev Bug: 68198078 Test: Tested on device Change-Id: Iff767cd6bf7408b45ce9594628d3fd0a71744e9f" 2018-07-19 02:10:46 +00:00
Raff Tsai
0f4affb9a0 Merge "Fix AlertDialog corner and color accent" 2018-07-19 01:00:28 +00:00
TreeHugger Robot
4cbf887d94 Merge "Convert SavedAccessPoints to DashboardFragment (step 1)" 2018-07-19 00:25:14 +00:00
TreeHugger Robot
1d7ee9b997 Merge "Clean up saved network screen" 2018-07-18 23:32:10 +00:00
Fan Zhang
d5547c68bf Convert SavedAccessPoints to DashboardFragment (step 1)
Change-Id: I5d8fa8497e04c9314dead9af7534df4507ffd591
Bug: 64806699
Test: robotest
2018-07-18 16:21:24 -07:00
Fan Zhang
661049f4d9 Clean up saved network screen
Bug: 64806699
Test: rebuild
Change-Id: I4392809f08034c7c13575db2f5c41468fcea0987
2018-07-18 15:13:21 -07:00
TreeHugger Robot
ad2e828f57 Merge "Unrestrict SMS/PHONE app if it been set active" 2018-07-18 20:43:38 +00:00
Aarthi Balachander
d0f835981c Use the migrated injected setting code in settingslib.
Manual merge to master from pi-car-dev
Bug: 68198078
Test: Tested on device
Change-Id: Iff767cd6bf7408b45ce9594628d3fd0a71744e9f
2018-07-18 13:34:25 -07:00
jackqdyulei
f1213365fc Unrestrict SMS/PHONE app if it been set active
If an app been set default SMS/PHONE app, we need to unrestrict this
app. This CL extract a common function and invoke it when necessary.

Change-Id: Id29c5138438aa6f6f22cdd9c4ecf336de8481782
Fixes: 80305978
Test: robotests
2018-07-18 12:32:34 -07:00
tmfang
1d44acce67 Fix test cases broken
- AndroiX AlertDialog needs to use Theme.AppCompat.
- Create a ShadowAlertDialogCompat which can be compatible with AndroidX AlertDialog.

Fix: 111247403
Test: make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.password.ChooseLockTypeDialogFragmentTest

Change-Id: I3e4bca285ecaefa5705c8d170050c21d1bc649e0
2018-07-18 19:39:39 +08:00
Raff Tsai
0810afee9b Fix AlertDialog corner and color accent
- Add some attributes in Theme.AlertDialog

Change-Id: Ifb9ca98ee11f6c82cda4a576d10b5fde54f788be
Fixes: 110917586
Test: mannual
2018-07-18 15:40:51 +08:00
TreeHugger Robot
5700ff5dde Merge "Remove LocalePickerWithRegion class in Settings." 2018-07-18 07:38:38 +00:00
Jason Chiu
9b5020c1d2 Fix a test broken by fragment migration.
Change-Id: I68e4f9b53d3492817ea9416fd4127fbe15337ce6
Fixes: 111193572
Test: robotests
2018-07-18 10:53:28 +08:00
Pavel Grafov
0844fb92d8 Use primary user's LOCK_SCREEN_SHOW_NOTIFICATIONS.
Only primary user can set LOCK_SCREEN_SHOW_NOTIFICATIONS,
profile can only set notifications to be redacted. When the
user changes notification settings for a work app, this class
is invoked from the profile, meaning it attempts to read
LOCK_SCREEN_SHOW_NOTIFICATIONS for the profile, which is not
there. As a result the function always returs 0 for work apps.

Bug: 111112011
Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/notification/VisibilityPreferenceControllerTest.java
Change-Id: Ifb50209ea8ea8fb6639f00ca8b7cf8a4295890ad
(cherry picked from commit f14de789f4)
2018-07-17 23:28:34 +00:00
Lei Yu
1582ec3db7 Unrestrict app if it been set as device admin app
Bug: 110337989
Test: RunSettingsRoboTests
Change-Id: I8229bee97d970f8b16351193cfd99ca05ff041bf
Merged-In: I8229bee97d970f8b16351193cfd99ca05ff041bf
(cherry picked from commit f87897b84c)
2018-07-17 23:28:31 +00:00
jackqdyulei
35015741b2 Hook up anomaly active hour to BatteryTipPolicy
So we can control it from server side.

Bug: 80192137
Test: RunSettingsRoboTests
Change-Id: Ic9a4db44029bdcd7e45f4f9fb6b7d71c8c07c429
2018-07-17 15:42:52 -07:00
TreeHugger Robot
d3e18dcf0a Merge changes from topic "rm_odr_anomaly"
* changes:
  Move anomaly code to BatteryTipUtils
  Remove the anomaly detection added in O-DR
2018-07-17 21:09:36 +00:00
jackqdyulei
5918cd5ff9 Move anomaly code to BatteryTipUtils
Then we could reuse it across settings.

Bug: 74529048
Test: robo test that cover each components still pass
Change-Id: Ied0bbc6e6a1dca9628c2c084c3284ffab2f85160
2018-07-17 12:42:57 -07:00
jackqdyulei
dd9b8af6b9 Remove the anomaly detection added in O-DR
1. Remove unused class and resources
2. Update function in AdvancedPowerUsageDetail since
we don't need pass in anomaly anymore

Change-Id: I96fbe5ddaae902b34b756c7aae0338e49afef1f3
Bug: 74529048
Test: 1. manual test in settings page. 2. robo test still pass
2018-07-17 12:42:43 -07:00
TreeHugger Robot
2e246bb66c Merge "Allow activity to delegate onActivityResult to fragments" 2018-07-17 19:30:39 +00:00
Fan Zhang
af32e726e6 Allow activity to delegate onActivityResult to fragments
Change-Id: Iac388f1726269239313d666f3123f28348e0c90a
Fixes: 111531567
Test: rototests
2018-07-17 10:59:02 -07:00
tmfang
c0ed614252 Remove LocalePickerWithRegion class in Settings.
This class is too complex, we can't afford maintaining this long term.
We need a new Activity that wraps the framework version of LocalePickerWithRegion.

Bug: 111373939
Test: manual test & make RunSettingsRoboTests -j56

Change-Id: I93c719246b84350d2eee4e8ce1ffd97cd168925b
2018-07-17 17:34:00 +08:00
Jason Chiu
baea63bf72 Fix a test broken by fragment migration.
Test: make ROBOTEST_FILTER=SettingsLicenseActivityTest RunSettingsRoboTests
Bug: 111194177
Change-Id: Ifd2d980bbf397ad9875b43d654ab4fc52c4627c2
2018-07-17 15:46:48 +08:00
TreeHugger Robot
e64a75812e Merge "Add a back-up icon resource to icon-less Slices" 2018-07-17 00:21:23 +00:00
Matthew Fritze
c38f7e1d0a Add a back-up icon resource to icon-less Slices
Currently, when a Settings Slice dosen't have an icon, we add an IconCompat
object with the resource 0x0 - which gives an empty icon. This is from the UX
direction that we should only have icons for Settings Slices when the
corresponding Settings have icons in the Settings UI.

However, this causes an issue with a recent change to SliceView, which crashes
the UI when a Slice is rendered without an icon. Previously, the icon code path
was only exercised when the Slice Shortcut view was being used, but after the
change, the icon path is always used and thus crashes when trying to fetch a
resource with id 0x0 from Settings or another provider.

About 2/3rds of Settings Slices do not have icons.

This change adds the Settings App icon as the back-up icon for any Slice which
would otherwise not have an icon.

The impact of missing this change is:
- Settings Slices cannot be shown in launcher spaces until a post-P update comes
from the support library.
- If Settings launches with the bug, Slices cannot patch the API which would require
all Slices to have a non empty icon (b/111438616)

Bug: 111082093
Test: Robotests, Settings Search UI testing, Slice browser testing
Change-Id: I6f326b6b41bf59011a211c6340dd639f68e754e1
2018-07-16 15:34:24 -07:00
Fan Zhang
420f385a18 Fix a incorrect type cast for alert dialog
Change-Id: I2265c4510785f88ef7950cd29779848eb2e58dc4
Fixes: 111488148
Test: manual
2018-07-16 12:23:57 -07:00
TreeHugger Robot
c5e51f0317 Merge "Disallow VoiceInteractionService as assist on LowMemDevice" 2018-07-13 21:27:19 +00:00
Jordan Liu
a9ec524463 Merge "Preserve leading 0s in mcc mnc" 2018-07-13 20:57:52 +00:00
Fan Zhang
b918f226d7 Disallow VoiceInteractionService as assist on LowMemDevice
Bug: 111443156
Test: robotests
Change-Id: Ic3413af2b5450c43c4749b7748b676a01209a5ac
2018-07-13 12:55:50 -07:00
Jordan Liu
21d5942006 Preserve leading 0s in mcc mnc
Fixes: 79408450
Test: ApnEditorTest.java
Change-Id: Iad7ffe04f23b30857588e50d7f5f0dd307bd2c6e
2018-07-13 10:44:39 -07:00
TreeHugger Robot
3889acd53f Merge "Fix 2 tests broken by fragment migration." 2018-07-13 17:20:48 +00:00
Hall Liu
f0072b7345 Fix usage of SubscriptionInfo ctor
Use string arguments instead of ints for mcc/mnc

Bug: 35064313
Test: manual, unit
Change-Id: Ib460d6294d8fb86de7c2fee065defb0a890af15a
(cherry picked from commit 02c5f3c7ac)
2018-07-13 10:13:46 -07:00