Commit Graph

12540 Commits

Author SHA1 Message Date
jasonwshsu
9f54ab9afa Redesign roles of variable mUserShortcutTypesCache & mUserShortcutTypes
* mUserShortcutTypesCache -> get value from savedInstanceState only
* mUserShortcutTypes -> use local variables to replace its mission

Bug: 158540780
Test: atest ToggleFeaturePreferenceFragmentTest
Change-Id: I1473f89ed743261f616e8d19733bae829c9dbb02
2020-11-05 14:24:09 +08:00
pihuei
55fb2b745d Use system day/night to switch theme instead of from intent extra.
Use value-night to give theme instead of directly from intent extra when Setup day/nNight mode enabled and in Setup flow

Before:
<vision settings>
https://hsv.googleplex.com/4837266235064320
<wifi dialog>
https://hsv.googleplex.com/5687053981319168
<lock screen with disabling button>
https://hsv.googleplex.com/4843506419892224
<lock screen with enabling button>
https://hsv.googleplex.com/5650348922372096
<fingerprint intro>
https://hsv.googleplex.com/5133769046491136
<fingerprint touch>
https://hsv.googleplex.com/5681937198874624
<fingerprint left touch>
https://hsv.googleplex.com/5767441676238848
<squeeze release>
https://hsv.googleplex.com/6632476812247040

After:
<vision settings>
https://hsv.googleplex.com/6213298875793408
<wifi dialog>
https://hsv.googleplex.com/6025790804197376
<lock screen with disabling button>
https://hsv.googleplex.com/5747461219942400
<lock screen with enabling button>
https://hsv.googleplex.com/5766700781797376
<fingerprint intro>
https://hsv.googleplex.com/6751334529236992
<fingerprint touch>
https://hsv.googleplex.com/5625963293442048
<fingerprint left touch>
https://hsv.googleplex.com/4518139360444416
<squeeze release>
https://hsv.googleplex.com/5220720579706880

Bug: 169734655
Test: robo test
Change-Id: I4aab843e28a932c7b823f36f1d8df1e5b2341f4e
2020-11-05 05:09:14 +00:00
Hugh Chen
7d71081d45 Add condition to check case of accessory combinations
Before this CL, we only compare whether the value of function is
equal to accessory to ensure usb is in accessory mode. But in some
cases there are different accessory combinations, like
"accessory,audio source". It will make the condition return false
when encountering accessory combinations.

This CL will check whether the function will include accessory mode
to fix this issue.

Bug: 162451162
Test: make -j42 RunSettingsRoboTests
Change-Id: I7c80f02de5340799e292949608e19b86b187b982
2020-11-04 17:25:29 +08:00
Treehugger Robot
e0347c87fd Merge "Fix crash on "Connection preferences"" am: b75c952800 am: 3cda0e9872 am: 32129f14f5
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1485157

Change-Id: I46ad006bdb3700ac4cba29711db589e5afaca448
2020-11-04 09:18:32 +00:00
Treehugger Robot
32129f14f5 Merge "Fix crash on "Connection preferences"" am: b75c952800 am: 3cda0e9872
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1485157

Change-Id: Ia27ac5edeca976fbc0e34d60596566f4432e8f5c
2020-11-04 08:56:00 +00:00
Treehugger Robot
b75c952800 Merge "Fix crash on "Connection preferences"" 2020-11-04 08:14:27 +00:00
TreeHugger Robot
855fc1ef61 Merge "[Testing] To migration NetworkScorerPickerPreferenceControllerTest" 2020-11-04 03:37:45 +00:00
Chloris Kuo
e9d524ffc6 Merge "Add flag to reset notification channel importance" 2020-11-03 14:07:45 +00:00
Hugh Chen
eda6d60e05 Fix crash on "Connection preferences"
This CL adds a null check condition to avoid crash for
some device not support PrintManager.

Bug: 159848003
Test: make -j42 SettingsGoogle
Change-Id: Ic6c4c17bb563458f4f5a61dc0d93ae22b05f8763
2020-11-03 11:02:38 +08:00
Sarah Chin
7f2a6040ef Update setCdmaRoaming/SubscriptionMode APIs
Test: atest TelephonyManagerTest
Test: make RunSettingsRoboTests
Bug: 171884158
Bug: 171883908
Change-Id: Ib78149c41612d56a46974621eb71b5e0cfe97c5a
2020-11-02 14:39:55 -08:00
SongFerngWang
22e18a86cc [Testing] To migration NetworkScorerPickerPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Add a function which loads the Settings Resource.

Diff: https://diff.googleplex.com/#key=81Ufa1AWkLAi
Bug: 172047348
Test: atest -c NetworkScorerPickerPreferenceControllerTest
Change-Id: I9c1a4f957b92ab572eadbd8a0804bdc83608230b
2020-10-30 13:34:22 +00:00
Yi Jiang
f68e8e32ec Merge "Hides Screen Attention setting on unsupported devices" 2020-10-30 03:45:34 +00:00
Sarah Chin
d84135e91d Merge "Hide 'View plan' button in data usage settings" am: 07f2c27cbf am: 94cabf8a02
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1480638

Change-Id: I2026849d4e4b4d057ea1f1d399994faedf913e1c
2020-10-30 03:35:16 +00:00
Sarah Chin
07f2c27cbf Merge "Hide 'View plan' button in data usage settings" 2020-10-30 02:48:14 +00:00
Sarah Chin
d6e4e9d8fe Hide 'View plan' button in data usage settings
There are currently no callers of the setSubscriptionPlan() API that
have a MDP app set up. Remove the button when SubscriptionPlans are
defined, since it does nothing and causes confusion for users.

Test: manually verify button does not exist when a plan is defined
Test: make RunSettingsRoboTests
Bug: 169806315
Change-Id: Ieda020bfa692e9465d6297e50cf338deff91a8a9
Merged-In: Ieda020bfa692e9465d6297e50cf338deff91a8a9
2020-10-29 16:36:28 -07:00
Yi Jiang
a56be2d614 Hides Screen Attention setting on unsupported devices
Bug: 170971817
Test: make RunSettingsRoboTests
Change-Id: I8aa7882be9a1ae483e8e7500059a18859b20d42b
2020-10-29 13:16:48 -07:00
Chloris Kuo
f64ce9e5e4 Add flag to reset notification channel importance
Add a button in development option to unlock user previously changed
notification importance and allow NAS to change the importance

Test: make RunSettingsRoboTests
Change-Id: I55b5349d6a17a383888c59b9126832c2fb8c58a0
2020-10-28 19:46:46 -07:00
Fan Zhang
005b47249e Merge "Rename panic gesture to emergency gesture in Settings" 2020-10-28 17:02:21 +00:00
Neil Fuller
be3b9ffeaa Merge "Fix review comments location_time_zone_detection" 2020-10-28 09:38:33 +00:00
Jeremy Goldman
a14d7504bb Merge "Fix flaky JUnit test" 2020-10-28 08:34:51 +00:00
Jeremy Goldman
125301d590 Fix flaky JUnit test
This test sometimes fails in PostSubmits because the background
thread which calls the verified class does not have time to execute
before the class is verified.

This creates a helper function to monitor background thread completion.

Test: atest -c AutoSelectPreferenceControllerTest
Change-Id: I6c320abd70fcb5fe823ec122fb0dac67174ecb4a
2020-10-28 05:15:52 +00:00
Neil Fuller
1affbfff83 Fix review comments location_time_zone_detection
Fix review comments for location_time_zone_detection.xml and associated
classes from http://ag/12792958.

Bug: 152746236
Test: Manual: build / boot / toggle switch in SettingsUI / inspect output of adb shell dumpsys time_zone_detector
Test: Manual: build / boot / install TestDPC / toggle switch in work profile in SettingsUI / inspect output of adb shell dumpsys time_zone_detector
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.TimeZoneDetectionPreferenceControllerTest"
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.LocationTimeZoneDetectionPreferenceControllerTest"
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.TimeZoneDetectionSettingsTest"
Change-Id: I641f312cd63359f45664a93e009e5a975dbd6485
2020-10-27 20:34:15 +00:00
Fan Zhang
f797a48af6 Rename panic gesture to emergency gesture in Settings
Bug: 171589858
Test: rebuild
Change-Id: I23847db82a397bdcd61501758e3ef66a4f088e22
2020-10-27 12:46:41 -07:00
Jeremy Goldman
1d068385c6 Mock SystemProperties in CDMA JUnit test
Bug: 170608563
Test: atest -c CdmaSubscriptionPreferenceControllerTest
Change-Id: Ibeca5e508d8277a9b84e26829e085c43ce7c26cc
2020-10-27 09:50:42 +00:00
TreeHugger Robot
167362d0ca Merge "Rename panic button in framework settings." 2020-10-26 20:27:50 +00:00
TreeHugger Robot
76c9a32dbb Merge "Update related UI if battery is not present" 2020-10-26 04:53:49 +00:00
Fan Zhang
6fef72aae4 Rename panic button in framework settings.
Renamed panic to "emergency" or "emergency gesture" to
avoid speculation once source code is accessible to
parties without full context.

The settings string and file names still use the word "panic". This
will be updated in a follow-up CL

Bug: 169946710
Test: rebuild
Change-Id: Ic1a3181145ca2b64ab6ef2a2989224395fa9a6f8
2020-10-23 22:51:01 +00:00
Mill Chen
ad99e2ef38 Update related UI if battery is not present
This change is to update the related UI in the battery page if the
battery is not present. This includes the following updates:
1. Update the summary of battery tile in the Settings homepage
2. Replace the battery level with "Unknown"
3. Replace the summary with help message in the battery page
4. Remove the battery meter icon

Bug: 171368508
Test: verify on an issue device
Change-Id: I892e0d137143160a0bce0c11ce9265120ebb8fd4
2020-10-23 23:35:15 +08:00
Julia Reynolds
5ff16e18e2 Merge "Add 'Recent Conversations' to the conversation page" 2020-10-23 14:35:46 +00:00
Weng Su
8f8348dc7b Fix the Wi-Fi detailed settings un-editable issue. am: f914e34d28
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12894947

Change-Id: I60460fb5f945eab4d70e28d47868d611b9c564da
2020-10-23 14:25:53 +00:00
Neil Fuller
c91bcbd0d5 Merge "Changes to location settings for geotz" 2020-10-23 09:40:45 +00:00
Neil Fuller
f418b7a968 Merge changes I868d1912,Id483ca41
* changes:
  Fix search test using location_settings
  Revert "Stop search tests using location_settings"
2020-10-23 09:24:43 +00:00
Hall Liu
9146943bb5 Merge "Replace TelephonyManager methods for mobile data" am: c2a4d3ec70 am: 4af7d6a7d2 am: d51ee68578
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1470180

Change-Id: I9c1496152155d3db0bd4c29502e7d43f6335ee86
2020-10-22 22:22:47 +00:00
Hall Liu
d51ee68578 Merge "Replace TelephonyManager methods for mobile data" am: c2a4d3ec70 am: 4af7d6a7d2
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1470180

Change-Id: I6ad3c840463bcb070769e9d91b2671d09f359369
2020-10-22 21:49:15 +00:00
Sally Yuen
4bca97c3cc Merge changes from topic "a11y_rbc"
* changes:
  Add activity for directly navigating to Reduce Bright Colors setting page
  Add a setting page for Reduce Bright Colors under A11y
2020-10-22 18:20:25 +00:00
Neil Fuller
4a6663c10a Changes to location settings for geotz
This change adds a new entry for geolocation-based time zone detection
(shorthand: "geotz") to the location settings.

The UI code uses information retrieved via the TimeManager API to keep
the conditional logic in one place, i.e. to avoid the UI needing to know
too much about the various conditions that affect the availability /
applicability of the toggle.

Screen variations / conditions / other info:

Location settings screen:

1) The entry only shows up on a device at all if geotz detection is
enabled for the device (currently a compile time setting, off by
default).
2) The new entry is hidden on the screen when the user first opens it.
To see it, the user has to expand "Advanced". The setting is in the
shared (non-GMS) section of the screen.
3) When visible, the entry has a summary that shows the current status:
either a reason why the setting is not applicable, or the user's current
setting value.
4) Selecting the entry opens a sub-screen.

The code included here distinguishes between different cases with the
summary message (i.e. the text underneath the entry). See strings.xml
for the placeholder text. Some strings will not show up currently, but
are included in case the rules change as they are valid possibilities
from the TimeManager API.

The same changes have been made for the "personal" tab when a work
profile is enabled.

Location Time Zone Detection settings screen:

1) The toggle is always enabled and always shows the user's current
configuration setting.

All manual tests run with the geotz feature enabled with:

adb shell setprop \
    persist.sys.location_time_zone_detection_feature_enabled 1

Bug: 152746236
Test: Manual: build / boot / toggle switch in SettingsUI / inspect output of adb shell dumpsys time_zone_detector
Test: Manual: build / boot / install TestDPC / toggle switch in work profile in SettingsUI / inspect output of adb shell dumpsys time_zone_detector
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.TimeZoneDetectionPreferenceControllerTest"
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.LocationTimeZoneDetectionPreferenceControllerTest"
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.TimeZoneDetectionSettingsTest"
Change-Id: Ia853d30bc54a113000b30f48776418f262d98358
2020-10-22 15:48:55 +01:00
Neil Fuller
94a64d6139 Fix search test using location_settings
Second attempt to proactively fix a search test.

SearchIndexableResourcesTest uses the FakeIndexProvider, which
implicitly assumes that the
robotests/res/xml-mcc999/location_settings.xml xml is in use. Without
it, the test is accessing the real location_settings.xml / real
preference controllers. This  was working until now, but by luck and
probably not intent.

There is an upcoming change which will break the test, so this fixes the
test ahead of time.

This change updates the test to use the "mcc999" config, and improves
the docs around FakeIndexProvider to try to make the requirements for
use clearer.

Bug: 171371424
Test: m RunSettingsRoboTests
Change-Id: I868d191281a2030fa49134893bcd6720f757ea91
2020-10-22 15:46:39 +01:00
Neil Fuller
d11f93babe Revert "Stop search tests using location_settings"
This reverts commit b71f7af512b506ee74f75f92a1cc254018c3c924.

Bug: 171371424
Test: m -j30 RunSettingsRoboTests
Change-Id: Id483ca41d3aced0893f0eff370270b5010eb8a7a
2020-10-22 15:38:23 +01:00
Hall Liu
17ba8166a3 Replace TelephonyManager methods for mobile data
TelephonyManager had a minor refactor of some of the methods revolving
around mobile data. Change code in Settings to use the new ones instead.

Exempt-From-Owner-Approval: Cherry-picked from internal
Bug: 169367013
Test: existing unit tests, manual
Change-Id: I7ebae37373d53fb2c59b6b546232dbddf77398d4
Merged-In: I7ebae37373d53fb2c59b6b546232dbddf77398d4
2020-10-21 23:38:20 +00:00
Sally
b9ff672a31 Add a setting page for Reduce Bright Colors under A11y
This is essentially a copy page of ToggleDaltonizerPreferenceFragment.
We extend ToggleFeaturePreferenceFragment to maintain consistency with
other shortcut assignable a11y feature.

UI is a draft

This CL:
1) allows users to enabled/disable RBC with the a11y shortcut (button,
gestures, volume keys), if assigned
2) adds a slider and persist switch to the template
ToggleFeaturePreferenceFragment page (which already contains a feature
switch, shortcut preference, and footer description)
3) enables/disables the intensity slider when RBC is on/off
4) sets placeholders for calling into ColorDisplayService in
controllers and tests
5) follows convention set by other color transformations settings and
places feature under Experimental section in A11y settings page if
transformations can't be efficiently performed by hardware

Test: A11y setting and page appears, tested activation with shortcut,
preference controller tests
Bug: b/128465252

Change-Id: I291bb86ce3d855ce052ca70dc7a941a888e2c723
2020-10-21 23:08:53 +00:00
Julia Reynolds
0aef57d67e Add 'Recent Conversations' to the conversation page
Test: atest
Bug: 171191376
Change-Id: Id7208312dff0cc022c2f16b3872fae1a9dc09ed7
2020-10-21 16:39:04 -04:00
Weng Su
f914e34d28 Fix the Wi-Fi detailed settings un-editable issue.
- The WifiEntry info might not be ready in early stage. (ex:
WifiEntry#canSetPrivacy())

- The Wi-Fi detailed setting listens to the WifiEntry callback to
refresh the preferences, it should first update the preference status to
be editable or not, and then display preferences to the UI.

- The privicy preference should be able to set back to selectable when
WifiEntry#canSetPrivicy() change from false to true.

Bug: 170148009
Test:
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiNetworkDetailsFragment2Test
make RunSettingsRoboTests
ROBOTEST_FILTER=WifiPrivacyPreferenceController2Test

Change-Id: I48ca060e6b468232f19c82e9de0ce4fce39cba7f
Merged-In: I567b2b80163631a01d165c0ac5c0aba392e014ef
2020-10-21 16:39:58 +00:00
Neil Fuller
c79680cbae Merge "Stop search tests using location_settings" 2020-10-21 11:21:29 +00:00
Neil Fuller
c970f4d79c Stop search tests using location_settings
Stop robolectric search tests using location_settings, use
sound_settings instead.

The choice of location_settings.xml seems arbitrary, and there's a
commit coming which means one of the controllers doesn't just use
settings to check availability. When the unconfigured mock returns null
from a method, that causes the test to fail in a non-obvious way.

Bug: 171371424
Test: m RunSettingsRoboTests
Change-Id: I4d3386e3c62fb4151e4a4e27625edccec89316d9
2020-10-21 09:25:57 +00:00
Bonian Chen
d682b2cc57 Merge "[Settings] Only display 1 SIM UI when multiple with same group UUID" 2020-10-21 08:37:37 +00:00
SongFerng Wang
c023d49669 Merge "To fix bug, summary is wrong if nr_enabled_bool=false" into rvc-qpr-dev am: 3e5defe561 am: 9493731935
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12875667

Change-Id: I3b06b785b0ae6d907f7cd6f09d7830c5b8cdb0c3
2020-10-21 08:36:22 +00:00
SongFerng Wang
9493731935 Merge "To fix bug, summary is wrong if nr_enabled_bool=false" into rvc-qpr-dev am: 3e5defe561
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12875667

Change-Id: I2b69a34d035e70cbc1bea9a2482be876eeabda66
2020-10-21 08:19:13 +00:00
Bonian Chen
a6b249d625 [Settings] Only display 1 SIM UI when multiple with same group UUID
Some carrier(s) expand their service through providing eSIM in companion
with pSIM. Group UUID is designed to group them together as an single
SIM.

Bug: 165363542
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SubscriptionsPreferenceControllerTest
Change-Id: I0934a45a2917ab106627c733162efbee9a13f216
2020-10-21 13:31:04 +08:00
Jeremy Goldman
29c4b84312 Merge "Update JUnit test readme to include atest command." 2020-10-21 04:08:21 +00:00
Yanting Yang
3f92484ce8 Merge "Remove subtitles for the homepage IA" 2020-10-21 03:24:31 +00:00