Commit Graph

1240 Commits

Author SHA1 Message Date
Sunny Shao
429d7624fb Fix Talkback say twice in MainSwitch
- Remove the duplicated setting in the ContentDescription.

Bug: 191735947
Test: manual test
Test: make RunSettingsLibRoboTests -j ROBOTEST_FILTER=com.android.settingslib.widget
Change-Id: If28d0002dd1087173623b654c67bc7597d721a85
2021-07-01 15:17:13 +08:00
PETER LIANG
dc68f8f303 Merge "Extend to support the static and animated format image for IllustrationPreference." into sc-dev 2021-06-30 00:38:20 +00:00
TreeHugger Robot
a8fd69468a Merge "Start the web help page in the correct user" into sc-dev 2021-06-29 18:55:24 +00:00
arangelov
c7c113d4df Start the web help page in the correct user
Test: ManagedDeviceActionDisabledByAdminControllerTest
Test: manually observed the policy transparency dialog
with launching the admin policies screen
Test: manually observed the policy transparency dialog
with launching the web help page
Fixes: 191727929

Change-Id: I03aaf2ddbaff3ea515404b257d1590c08ae3ab65
2021-06-29 14:56:54 +01:00
Peter_Liang
a6635f42e9 Extend to support the static and animated format image for IllustrationPreference.
Actions:
1) Migrate and deprecate the widget AnimatedImagePreference
into SettingsLib IllustrationPreference. It would extend
to support the static (e.g., svg, png), animated (e.g., gif)
and lottie format image.
2) Create setImageUri() for IllustrationPreference.
3) Create setImageDrawable() for IllustrationPreference.

Bug: 190585192
Test: make RunSettingsLibRoboTests ROBOTEST_FILTER=com.android.settingslib.widget.IllustrationPreferenceTest
Change-Id: Iad5bc6af78cca4d57cb56eec104ef2384da7be9f
2021-06-29 15:14:42 +08:00
Arc Wang
e24824b9cc Shows ripple effect for SettingsSpinnerPreference
Before this change, only the spinner inside
SettingsSpinnerPreference is clickable. The preference
itself is not clickable.

After this change, whole preference area is clickable
and it will show dropdown view of the spinnner at
onPreferenceClick.

Bug: 187142293
Test: atest SettingsSpinnerPreferenceTest
      manual visual
      Inserts an USB flash drive and clicks SettingsSpinnerPreference
      in Storage Settings.
Change-Id: Ib4de017e6f5930f7b29c8958f2fe7f7dbe347324
2021-06-21 13:40:08 +00:00
Simon Wingrove
5db41a1887 Merge "Fix padding and touch target size on BannerMessage." into sc-dev 2021-06-18 14:40:43 +00:00
Simon Wingrove
87ea7ae2a5 Fix padding and touch target size on BannerMessage.
Padding between title and subtitle is 8dp should be 4dp.

Touch target on dismiss button is too small for a11y requirements. Use
a touch delegate on the card view to increase touchable size without
changing layout.

Bug: 190780536
Test: Manually confirmed new layout works
Test: Use adb shell input tap x y to touch dismiss button
Change-Id: I749ab2e7cba811d841804d73c13a2b792591dfa1
2021-06-18 11:31:09 +01:00
Kevin Chyn
b2e3ba68b0 Merge "Launch action to admin component when button clicked" into sc-dev 2021-06-17 01:28:17 +00:00
Kevin Chyn
c3e64b14c5 Merge "Add BiometricActionDisabledByAdminController" into sc-dev 2021-06-17 01:27:03 +00:00
Kevin Chyn
b35863580b Launch action to admin component when button clicked
Bug: 188847063
Test: "Set up parental controls" screen seen
Test: m -j RunSettingsLibRoboTests ROBOTEST_FILTER=BiometricActionDisabledByAdminControllerTest
Change-Id: Iad3ffbcd87fe3af5ebaf6a1e6078bf772606efc4
2021-06-16 16:41:14 -07:00
Kevin Chyn
4e84b8849a Add BiometricActionDisabledByAdminController
1) Adds UserManager#DISALLOW_BIOMETRIC. We actually need to
   pass a restriction from settings to ActionDisabledByAdmin area,
   otherwise the biometric-specific dialog would be shown outside of
   biometric flows.
2) Adds an interface to ActionDisabledByAdminController to return a
   optional OnClickListener for the positive dialog button
3) Returns an instance of the biometric controller when conditions
   are met
4) Adds string interfaces to DeviceAdminStringProvider to retrieve
   biometric-specific strings

Bug: 188847063
Bug: 191306258
Test: manual

Change-Id: Iaeffdeb1336d5db56d464104cdc7677b9021f609
2021-06-16 16:41:14 -07:00
Stanley Wang
0935e11743 Remove the pause icon from IllustrationPreference.
Fix: 189426848
Test: robotest and test the IllustrationPreference manually.
Change-Id: I6087adb99e6b23642d952165073e4e3468397dab
2021-06-15 16:15:58 +08:00
Bo-Kyung (BK) Choi
866cd6a1a4 Fix an issue that "Learn More" button was not showing up.
ActionDisabledByAdming dialog was not showing the "Learn More" button
when restriction is enforced by the device owner for
disallow_factory_reset.

Test: atest ActionDisabledLearnMoreButtonLauncherTest

Bug: 185248897

Change-Id: I835d3aa040bd3e554acc8340d47831a4c89c45de
2021-06-10 15:35:58 -07:00
Giuliano Procida
0d7e129066 Merge "Revert "Create SettingsLibSeekBarPreference"" into sc-dev 2021-06-08 09:55:58 +00:00
Edgar Wang
2af26922d1 Revert "Create SettingsLibSeekBarPreference"
Revert "Apply SettingsLib SeekBarPreference to a11y vibration se..."

Revert "Apply SettingsLib SeekBarPreference to SettingsGoogle"

Revert "Apply SettingsLib SeekBarPreference to a11y vibration se..."

Revert "Apply SettingsLib SeekBarPreference to Settings"

Revert submission 13422386-seekbar-sc-dev

Reason for revert: build broken in SettingsGoogle
Reverted Changes:
I0c2d0d5fb:Apply SettingsLib SeekBarPreference to SettingsGoo...
I1844bb3b0:Apply SettingsLib SeekBarPreference to a11y vibrat...
Ia3e4adec8:Apply SettingsLib SeekBarPreference to a11y vibrat...
Iadee57e9d:Apply SettingsLib SeekBarPreference to a11y vibrat...
I219878716:Apply SettingsLib SeekBarPreference to Settings
I959f5672c:Create SettingsLibSeekBarPreference
I92545a69c:Apply SettingsLib SeekBarPreference to a11y vibrat...

Change-Id: Ifdd10634f6481f29eb8c64b03e24c2dffe98ff2f
Bug: 176818438
2021-06-08 09:48:14 +00:00
Edgar Wang
57822e02ec Merge "Create SettingsLibSeekBarPreference" into sc-dev 2021-06-08 07:23:54 +00:00
Edgar Wang
99df382611 Create SettingsLibSeekBarPreference
- Move SeekBarPreference & LabledSeekBarPreference from Settings.
- Create RestrictedSeekBarPreference.
- Create interface Restrictable.
- Support config reserved icon space.

Bug: 176818438
Test: robotest

Change-Id: I959f5672cde027432e39f672dfff94e385d104e5
2021-06-04 13:34:59 +08:00
Stanley Wang
3f0812ea7c Merge "Switch control should not be activated after event happens off of the target region." into sc-dev 2021-06-03 10:29:29 +00:00
Stanley Wang
c2d91b650d Switch control should not be activated after event
happens off of the target region.

- Disable the focusable and clickable features.

Fix: 189079003
Test: robotest and test the switch manually
Change-Id: I0fa19c132ddfd5a3e010bf8328c6b84c1087d78b
2021-06-03 15:34:04 +08:00
Stanley Wang
ad87e56848 Merge "Improve the features of IllustrationPreference." into sc-dev 2021-06-03 06:07:33 +00:00
Stanley Wang
ee50d90e9d Improve the features of IllustrationPreference.
- Support the dynamic color.
  The colors of the illustration's labels can be changed.
  We create a mapping table of colors and labels.
  According to this mapping table, preference can
  apply the corresponding colors to the illustration.
- Support the middle ground view.
  User can overlay a view on top of the illustration.
- Support the auto scale of illustration.
- Update the layout to prevent the animation cropping.

Fix: 189199177
Test: rebotest and see the UI.
Change-Id: Ib02cbc5bb99ab8014d7ee7ed630a6721968a49ab
2021-06-03 11:25:53 +08:00
Les Lee
7b4645f35e Merge changes from topic "network_policy_for_supporting_merged_wifi" into sc-dev
* changes:
  wifi: Use new API for data usage function
  carrier data usage: Use carrier template as default policy
2021-06-02 03:37:54 +00:00
TreeHugger Robot
580476b758 Merge "Further refactoring on ActionDisabledByAdminDialog classes." into sc-dev 2021-06-01 20:13:24 +00:00
lesl
35c9bb8521 wifi: Use new API for data usage function
For mobile, a old API: buildTemplateMobileAll doesn't includes the
merged wifi network, call the new API: buildTemplateCarrierMetered
to replace the old one.

PS: Not only usage functionality but also apply to network policy
control since the default policy is changing to use
new API: buildTemplateCarrier now.

Test: atest -c DataUsageControllerTest
Test: atest -c NetworkCycleDataForUidLoaderTest
Test: atest -c NetworkPolicyEditorTest
Test: Manual Test, modify the mobile usage warming and limit bytes and
      check the data via adb shell dumpsys netpolicy
Bug: 176396812
Merged-In: I1c7da4a819e45009efe5ba2b80e1526ce6b04e27
Change-Id: I1c7da4a819e45009efe5ba2b80e1526ce6b04e27
2021-06-01 18:14:43 +08:00
Hugh Chen
2d71a9a5cd Fix test case fail in CachedBluetoothDeviceTest
Bug: 188948300
Test: make RunSettingsLibRoboTests
Change-Id: Ib42c9b4f840b64ffa2ceaf981dfd76d3195a18b2
2021-05-31 19:06:45 +08:00
Felipe Leme
4e6057e243 Further refactoring on ActionDisabledByAdminDialog classes.
Bug: 184107103
Bug: 188836559

Test: m -j RunSettingsLibRoboTests ROBOTEST_FILTER=FinancedDeviceActionDisabledByAdminControllerTest
Test: m -j RunSettingsLibRoboTests ROBOTEST_FILTER=ManagedDeviceActionDisabledByAdminControllerTest
Test: m -j RunSettingsLibRoboTests ROBOTEST_FILTER=ActionDisabledLearnMoreButtonLauncherTest

Change-Id: I3c4056d82834b5e2a4afbd958be7c9d0b9af543e
2021-05-26 19:18:37 -07:00
Jason Chiu
361ab7e1e8 Merge "[Injection] Stop using the component icon as a fallback option" into sc-dev 2021-05-26 07:11:05 +00:00
Felipe Leme
1cbeefce09 Merge "Refactored some com.android.car.settings.enterprise interfaces." into sc-dev 2021-05-25 19:13:18 +00:00
Hugh Chen
226a950aa1 Fix anr when open connected devices
When advanced bluetooth icon not in cache, return basic bluetooth
icon instead of advanved bluetooth icon.

Bug: 187898551
Test: make RunSettingsLibRoboTests
Change-Id: Iea2c7818e895e16e236931bc9d0e8bccae68b4e1
2021-05-25 15:12:31 +08:00
Felipe Leme
f324636932 Refactored some com.android.car.settings.enterprise interfaces.
They're now using a Context and Object instead of Activity and
AlertDialog.Builder, as the CarSettings implemention doesn't use
the latter.

Bug: 184107103
Bug: 188836559

Test: atest RunSettingsLibRoboTests:com.android.settingslib.enterprise.FinancedDeviceActionDisabledByAdminControllerTest && \
      atest RunSettingsLibRoboTests:com.android.settingslib.enterprise.ManagedDeviceActionDisabledByAdminControllerTest

Change-Id: Ifb08692f8b1973b8ffaeb98b29101b6a8f642922
2021-05-24 11:47:15 -07:00
Jason Chiu
ce685fa47b [Injection] Stop using the component icon as a fallback option
Settings displays the component icon as a fallback option if the
metadata doesn't contain icon and icon_uri. Some injections that don't
need an icon have set a transpatrnt color to skip the fallback option.

However, the new Settings requires that an item without an icon should
align with the border. The transparent icon makes the item unaligned.

Therefore, we remove the hidden fallback option, and also filter out
the transparent color icon for backward compatibility.

Bug: 186801104
Test: robotest
Change-Id: I9221bba896e4785901ad617aa8ee58e6028ecc72
2021-05-24 18:18:25 +08:00
Tsung-Mao Fang
b3533c8369 Merge "Add a learn more text in footerprefernce" into sc-dev 2021-05-22 01:41:11 +00:00
Tsung-Mao Fang
77f04f565c Add a learn more text in footerprefernce
Add this new learn more text view so that
It would keep the implementation and styling centralized
in our widget library, ensuring consistency.

Test: Check the learn more link works well.
Fix: 188009297
Change-Id: If88cc4c4b03047c53e1fa8f7025583bdee592013
2021-05-21 20:53:48 +08:00
Stanley Wang
f984db4b4a The MainSwitch should has the accessibility label.
Add the title to the content description of Switch.

Fix: 182228819
Fix: 182227784
Test: robotest and manually test the UI
Change-Id: I3cad922e903df783ee7eaf727b82f16f3345ff30
2021-05-20 16:02:18 +08:00
Antoan Angelov
392fd855a4 Merge "SettingsLib logic for updated ActionDisabledByAdminDialogHelper" into sc-dev 2021-05-19 13:50:07 +00:00
Marie Matheson
f5bb354999 Merge "Updates BannerMessagePreference to new style" into sc-dev 2021-05-19 08:26:03 +00:00
Marie Matheson
11ec9ba02f Updates BannerMessagePreference to new style
Updates the style of the BannerMessagePreference in v31 and adds support
for the following new functionality (all optional):
- Use one of three attention level themes: high, medium, and low
(default: high)
- Add an icon (default: alert icon)
- Subtitle (default: hidden)
- Dismiss button (default: hidden)

Icon, subtitle, and theme can also be set via xml attrs.

Adds support for creating a BannerMessage without a title.

Test: make -j80 RunSettingsLibRoboTests
Test: Manually tested all configurations
Bug: 181764215

Change-Id: I73bfc5225d83057e423b6a9d77a6277a656d3b90
2021-05-18 15:29:41 +00:00
TreeHugger Robot
77f3b08b09 Merge "Update ActionButtonsPreference style" into sc-dev 2021-05-18 11:28:56 +00:00
arangelov
51fd49accb SettingsLib logic for updated ActionDisabledByAdminDialogHelper
Fixes: 184107103
Test: manual
Test: atest FinancedDeviceActionDisabledByAdminControllerTest
Test: atest ManagedDeviceActionDisabledByAdminControllerTest
Change-Id: I894808fbde2bc325e7a0f5697dca760b631f210f
2021-05-17 17:20:07 +01:00
Wesley.CW Wang
e49dc874d3 Update ActionButtonsPreference style
- Add rounded background
 - Add divider between buttons
 Screenshots:
   https://screenshot.googleplex.com/5b3fanqgpbpufyD.png
   https://screenshot.googleplex.com/5jG85UeVk64pAMg.png

Bug: 187923403
Test: atest ActionButtonsPreferenceTest
Change-Id: I04bebbfc676c5c5d019a4dce1b8e31bfc69360d7
2021-05-14 17:55:34 +08:00
Tsung-Mao Fang
cb20b3ef4c Add ability of setting content description for footer
Test: Rebuilt lib and confirmed to set a content description for a footer
in Settings app. Then, talkback can say correct description.
Fix: 188009297
Change-Id: I7af451a553a13d5108ab279d149e4cdfdfcb620f

Change-Id: I06c5fbdfca25e287988ea8ef8eca56fcce10857a
2021-05-13 16:05:18 +08:00
Stanley Wang
1f6711ffd4 Merge "Create preference widget to support Lottie illustrations." into sc-dev 2021-05-12 04:05:55 +00:00
Stanley Wang
929b1490f9 Create preference widget to support Lottie illustrations.
Fixes: 186409607
Test: run robo test and see the UI
Change-Id: Ie78e6585dfe0aefeb6ffa50db3935e59010648f5
2021-05-11 20:51:18 +08:00
Arc Wang
9a4722e022 Add SettingsSpinnerPreference#setClickable
This change add the API for Storage Settings to set
the spinner not clickablewhen there is only 1 volume.

Bug: 187801712
Test: manual
      Click the spinner when there is only default volume.
      Click the spinner when there is USB drive connected.
Change-Id: I1e6d46c9772b641678085d41d4905022e893acc4
2021-05-11 20:36:55 +08:00
Edgar Wang
3b9df00cbb Rename resource name to avoid build conflict in another path.
Bug: 186881512
Test: manual & robotest
Change-Id: I2545c07e9a0e7cb77cf942605fcc447cb387c5ec
2021-05-10 16:13:27 +00:00
Edgar Wang
7948cf883c Merge "Update MainSwitchBar to Material Next style." into sc-dev 2021-05-08 07:30:06 +00:00
Stanley Wang
d979dbd6af Update MainSwitchBar to Material Next style.
Fix: 182255113
Test: Run robotest and see the ui
Change-Id: I2d407bb463a13ed986fe7fe3611e4c00c55284dd
2021-05-07 16:02:44 +08:00
Alex Stetson
c3f60fb944 Move HideNonSystemOverlayMixin to SettingsLib
To be re-used by settings applications for other form factors.

Bug: 184967544
Test: make RunSettingsLibRoboTests -j40
ROBOTEST_FILTER=com.android.settingslib.core.lifecycle

Change-Id: I749dbd3f24bf77453d3ecc5d4374d11656498850
2021-05-06 08:25:13 -07:00
lesl
7cee1c4f63 wifi: Use new API for wifi data usage function
For wifi, a old API: buildTemplateWifiWildcard will includes the merged
wifi which is included to mobile usage. It should not double count
again. Call new API: buildTemplateWifi with
NetworkId: NetworkTemplate.WIFI_NETWORKID_ALL
and null subscriberId to get non-merged wifi usage.

Test: atest -c DataUsageControllerTest
Test: Manual Test, wifi data usage count correctly.
Bug: 176396812
Change-Id: I047bc7dfe6a217c1a88faf3ed5c6783f33227c32
2021-05-04 09:52:30 +00:00