Commit Graph

295 Commits

Author SHA1 Message Date
Phil Weaver
ca32293e76 Merge "Clarify text shown in a11y service warning dialog" 2018-12-11 17:15:06 +00:00
Phil Weaver
fce1835ef5 Clarify text shown in a11y service warning dialog
Replacing the text generated from the service's
capabilities (which could change) with a generic message
based on the maximum capabilities (full control) a service
can obtain.

Bug: 110715236
Test: atest SettingsRoboTests
Change-Id: Iecb548c77c9031626d4da24741ec1f753d0cc94f
2018-12-10 11:27:30 -08:00
Leon Liao
d9c4044722 Fix content timeout item misorder in Display category in A11y Settings
A11y Content timeout item is disordered by program while device supports HWC
accelerated color transform. Add code to fix its order with present resource order.

Bug: 119283926
Test: atest AccessibilitySettingsTest
Test: make RunSettingsRoboTests
Change-Id: I5e8bff2347353d2c4fe9aa550d7efaa613bf2a90
2018-12-07 11:08:43 +08:00
Leon Liao
2457f46fa8 Add summary with accessibility timeout item
Add summary with accessibility timeout item in Accessibility
Settings. This summary describe its level to time limit of
Accessibility timeout feature.

Bug: 119283926
Test: atest AccessibilitySettingsTest
Test: atest AccessibilityTimeoutControllerTest
Test: make RunSettingsRoboTests
Change-Id: I86c096e6f4adb62150e1ff2af4c22afac240b41e
2018-12-05 05:35:54 +08:00
Leon Liao
fc29b1c331 Implement a11y UI for Accessibility timeout feature.
This UI control the Accessibility Timeout API in Settings App.
Add a user control to set timeout length to suit their need.

Bug: 119283926
Test: atest AccessibilityTimeoutControllerTest
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=CodeInspectionTest
Test: atest UniquePreferenceTest
Change-Id: Ic8f7337e6bd7739c1189382cc87d45465b64c6ed
2018-11-15 10:24:43 +08:00
Fan Zhang
f535055e2e Use safe icon when building unavailable slices.
And move ic_a11y_generic from mipmap to drawable. IconCompat doesn't
support mipmap.

Bug: 118691898
Test: robotests
Change-Id: I6799f3d31d2c5654319e5a97bf8ca14992e785a7
2018-10-30 14:48:47 -07:00
Philip P. Moltmann
fc9951091f Use SYSTEM_... window manager flags
Test: Built
Bug: 116798569
Change-Id: Iac0728b348b6105b843d83415f0abde2de3cb074
2018-10-09 13:45:10 -07:00
Fan Zhang
9aca4cb48c Add config to disable app tray preview in display size.
Also move some files

Change-Id: I4636fcd81425991acadede0b703e09513c82543c
Fixes: 113374067
Test: robotests
2018-09-10 15:03:54 -07:00
Philip P. Moltmann
e3f721132a RestrictedLockUtils was split into ...Internal
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.

This causes a lot of trivial code changes.

I also updated the ordering of the imports in all affected files.

Bug: 110953302
Test: Built
      make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
2018-08-30 08:11:39 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
9ce4a1fcde Use searchable="false" to suppress nonIndexables.
When possible, remove or simplify getNonIndexable() logic in fragments,
and use searchable="false" in xml to suppress index.

Change-Id: I5bdf5bc7d5494a64cdd9e230a51321a4b210af69
Fixes: 112608186
Test: robotest and manual search
2018-08-17 09:21:05 -07:00
Chienyuan
fca684aab6 Replace LocalBluetoothAdapter with BluetoothAdapter
LocalBluetoothAdapter is obsolete, use BluetoothAdapter instead.

Bug: 111810977
Test: make -j50 RunSettingsRoboTests
Change-Id: I5109a0296c1006a3c2e346bf966ef8901c101e30
2018-08-09 11:40:54 +08:00
timhypeng
53a12ee7b8 Add Hearing Aid UI into Settings-Accessibility App
- dynamically show/hide preference by HearingAid profile is supported or not
- add AccessibilityHearingAidPreferenceController to handle hearingAid preference
- add HearingAidDialogFragment to handle dialog behavior

Bug: 109948484
Test: make -j50 RunSettingsRoboTests

Change-Id: Ic55dde475dc40311f7e652f4a86d342597f09f0e
2018-07-30 16:48:39 +08:00
tmfang
41ab6b4bf8 Migrate all AlertDialogs to AndroidX version
This CL only changed AlertDialog imports.
So, reviewer can review it easily.

Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
2018-07-20 11:32:13 +08:00
Jackal Guo
6490923251 Change the order of preferences in a11y
Some preference items have the same order, and it makes these items
be sorted in different position per languages. Use unique order for
each items instead.

Bug: 77949267
Test: atest CtsAccessibilityTestCases
Test: manual check the order in different languages
Change-Id: Ibfcb316c4299266b053053d9d88819a7dcc158fa
2018-07-17 11:19:05 +08:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -07:00
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Fan Zhang
af1552251f Add some pages to search index.
* Notification access page
* VR Listener page
* Feature flags in dev options
* QS Tile developer options
* User dictionary
* Billing cycle
* Some accessibilty pages

Bug: 70720645
Test: robotests
Change-Id: I4f7d3d65b2803cebf178ac345a79721232df707c
2018-07-11 16:39:29 -07:00
Fan Zhang
78ea7da54c Misc tweaks to Indexable usage and tests.
- Make SettingsPreferenceFragment implement Indexable directly
- Add existing fragments that are SettingsPrefFragment but not Indexable
  to grandfather list.
- Fix "font size" fragment so it shows up in search properly.
- Remove duplicates for "lock screen display", "Screen saver".

Bug: 70720645
Test: robotests
Change-Id: I44ce0cac0fdf5e882b315861bb4bebc45dbe01e6
2018-07-02 16:46:23 -07:00
hjchangliao
bc64434365 Add TogglePrefController for Color Invert
Add ColorInversionPreferenceController,
and remove old control code in fragment.

Change-Id: I773e5aa2d6c9bf6b5140be45ee60567a7ed22318
Fixes: 67997748
Test: make RunSettingsRoboTests
2018-06-22 10:03:25 +08:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Michael Wright
1c7ae169ac Merge "Hide haptic intensity settings for devices without enough dynamic range." into pi-dev am: 8c60fc69b7
am: 23460d03bc

Change-Id: I5c5e8a4157874f19abe28201fba772c72bc7f9d9
2018-05-25 19:17:33 -07:00
TreeHugger Robot
8c60fc69b7 Merge "Hide haptic intensity settings for devices without enough dynamic range." into pi-dev 2018-05-26 02:03:09 +00:00
Alexey Kuzmin
d335f6124e Merge "Add vibration preview" into pi-dev am: 1ec06d4623
am: 6a090b46cf

Change-Id: Ia326faa0639ae6357df23d70f570eb7f3cd0d9e6
2018-05-25 18:09:19 -07:00
TreeHugger Robot
1ec06d4623 Merge "Add vibration preview" into pi-dev 2018-05-26 00:58:16 +00:00
Michael Wright
304f44b94a Merge "Add michaelwr to OWNERS for haptics settings in accessibility" into pi-dev am: 76e0cb6678
am: 5c2736823e

Change-Id: Idd6054c7abf169d84c80e5493eba331c917e3f25
2018-05-25 17:33:37 -07:00
TreeHugger Robot
76e0cb6678 Merge "Add michaelwr to OWNERS for haptics settings in accessibility" into pi-dev 2018-05-26 00:20:44 +00:00
Michael Wright
c93dfd8f48 Add michaelwr to OWNERS for haptics settings in accessibility
Bug: 80243632
Test: N/A
Change-Id: Id315d626af527946230affc292ed9b329efe8b5b
2018-05-25 23:38:59 +01:00
Michael Wright
3dbaac6e71 Hide haptic intensity settings for devices without enough dynamic range.
Despite our hope, devices prior to P18 just don't have the dynamic range
to give three distinct vibration intensity settings. Given this, only
show an on / off toggle for devices by default unless they explicitly
opt-in to multiple intensity levels.

Test: m -j RunSettingsRoboTests
Bug: 80243632
Change-Id: I14ece855cf20f9fa44b0648d28f89c0053be5c5f
2018-05-25 22:57:03 +01:00
Matthew Fritze
61227fb093 Add remaining whitelisted controllers
Because I missed them in the long whitelist the first time...

Change-Id: I9fbd7b33e06b3f2f6e5e5778f78abfdb1a52006a
Merged-In: I01c8c80fe306667c1d3ac007b16fad546c5a5f40
Fixes: 79779103
Test: robotests
2018-05-24 17:29:03 +00:00
Matthew Fritze
0cb62643d6 Add remaining whitelisted controllers
Because I missed them in the long whitelist the first time...

Bug: 79779103
Test: robotests
Change-Id: I01c8c80fe306667c1d3ac007b16fad546c5a5f40
2018-05-24 10:27:29 -07:00
Matthew Fritze
1dd25fd87c Add isSliceable API to BasePrefController
Only support explicitly approved Settings Slices,
dictated by controllers which return true for the new
method isSliceable.

Updating the supported settings to a whitelist means that
the method to return all available slices must be updated,
and checking slicability when we index slices.

Test: robotests
Change-Id: I85848c2cdf3e151fa94b33dd1dc5c0374ef94b5b
Merged-In: Ib2b9690cdd0036b5cc4a1cb846c52bce7c824ab9
Fixes: 79779103
2018-05-22 22:43:24 +00:00
Matthew Fritze
bf1f5b5813 Add isSliceable API to BasePrefController
Only support explicitly approved Settings Slices,
dictated by controllers which return true for the new
method isSliceable.

Updating the supported settings to a whitelist means that
the method to return all available slices must be updated,
and checking slicability when we index slices.

Test: robotests
Bug: 79779103
Change-Id: Ib2b9690cdd0036b5cc4a1cb846c52bce7c824ab9
2018-05-22 11:06:42 -07:00
Alexey Kuzmin
cf663511db Add vibration preview
Test: Open vibration intensity settings, tap on any option. The preview
effect of selected intensity should be played back.

Bug: 74504389
Merged-In: Ie22ecb830752edb7a7515a3a6475587e72274e51
Change-Id: Ie22ecb830752edb7a7515a3a6475587e72274e51
2018-05-19 02:48:09 +01:00
hjchangliao
a92271c26d Convert Magnify controller to TogglePrefController
Convert below to TogglePreferenceController:
MagnificationNavbarPreferenceController
(Magnify with Button)
MagnificationGesturesPreferenceController
(Magnify with triple-tap)

The two controllers share the same fragment,
Add static method for set/get state in fragment,
And use them in controllers and fragment.

Change-Id: I2bdbdb36be71e1a3ffb557abc5a6115d48de53cf
Merged-In: I2bdbdb36be71e1a3ffb557abc5a6115d48de53cf
Fixes: 67997698
Fixes: 67997726
Test: make RunSettingsRoboTests
2018-05-16 16:45:47 +00:00
hjchangliao
2f73a6646f Convert Magnify controller to TogglePrefController
Convert below to TogglePreferenceController:
MagnificationNavbarPreferenceController
(Magnify with Button)
MagnificationGesturesPreferenceController
(Magnify with triple-tap)

The two controllers share the same fragment,
Add static method for set/get state in fragment,
And use them in controllers and fragment.

Change-Id: I2bdbdb36be71e1a3ffb557abc5a6115d48de53cf
Fixes: 67997698
Fixes: 67997726
Test: make RunSettingsRoboTests
2018-05-16 16:05:41 +08:00
AL Ho
ae2893db10 Update Accessibility vibration settings.
- Get notification vibration and haptic feedback intensity respectively.
- Use xliffs to compose these strings.
- Use the version that passed in Vibrator.class to get Vibrator
  instance.
- Refactor switch/case part in getSummary() of
  VibrationIntensityPreferenceController.
  Let AccessibilitySettings and VibrationIntensityPreferenceController
  both call it.
- Add robolectric test for method: updateVibrationSummary().
- Refine test method, use real preference and test summary value.
- Remove redundancy.

Bug: 75322064
Test: make ROBOTEST_FILTER=AccessibilitySettingsTest RunSettingsRoboTests
Change-Id: Ia3c7447b1ab1e336b36ad439800b673821417e48
Merged-In: Ia3c7447b1ab1e336b36ad439800b673821417e48
2018-05-11 08:56:13 +00:00
AL HO
204dcfdb4c Merge "Update Accessbility vibration settings." into pi-dev 2018-05-11 07:11:14 +00:00
AL Ho
92216ae148 Update Accessbility vibration settings.
- Get notification vibration and haptic feedback intensity repectively.
- Use xliffs to compose these strings.
- Use the version that passed in Vibrator.class to get Vibrator
  instance.
- Refactor switch/case part in getSummary() of
  VibrationIntensityPreferenceController.
  Let AccessibilitySettings and VibrationIntensityPreferenceController
  both call it.
- Add robolectric test for method: updateVibrationSummary().
- Refine test method, use real preference and test summary value.
- Remove redundancy.

Bug: 75322064
Test: make ROBOTEST_FILTER=AccessibilitySettingsTest RunSettingsRoboTests
Change-Id: Ia3c7447b1ab1e336b36ad439800b673821417e48
Merged-In: Ia3c7447b1ab1e336b36ad439800b673821417e48
2018-05-11 11:13:25 +08:00
rafftsai
17ebdcf6e6 Remove search option in Magnification settings
- AccessibilitySettingsForSetupWizardActivity add extra argument to hide
search and help menu. It applies to AccessibilitySettingsForSetupWizard.
Add extra in MagnificationPreferenceFragment when launch from SUW.

Fixes: 74195957
Test: am start -a android.settings.ACCESSIBILITY_SETTINGS_FOR_SUW

Change-Id: I8314e3a01907e0befa63b96271bfc2b15c5a1d50
Merged-In: I8314e3a01907e0befa63b96271bfc2b15c5a1d50
2018-05-10 20:51:07 +00:00
rafftsai
f5fffe3da6 Remove search option in Magnification settings
- AccessibilitySettingsForSetupWizardActivity add extra argument to hide
search and help menu. It applies to AccessibilitySettingsForSetupWizard.
Add extra in MagnificationPreferenceFragment when launch from SUW.

Fixes: 74195957
Test: am start -a android.settings.ACCESSIBILITY_SETTINGS_FOR_SUW

Change-Id: I8314e3a01907e0befa63b96271bfc2b15c5a1d50
2018-05-10 13:49:30 -07:00
Matthew Fritze
bd376296cd Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Fixes: 79245656
Test: robotests
Change-Id: I42c2cedab66be2d76999795f46470a079cc1ec71
Merged-In: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 10:03:40 -07:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -07:00
HJ ChangLiao
5693be2863 Replace PackageManagerWrapper with PackageManager
Replace all SettingsLib/PackageManagerWrapper in Settings,
by PackageManager,
Remove ShadowPackageManagerWrapper.

Bug: 62067063
Test: make RunSettingsRoboTests
Change-Id: I6d1af55c13d80c1907b98b21e0207cc903cd9b1f
2018-04-24 15:12:31 +08:00
Doris Ling
d63e19aa1d Fix footer text not translated in Magnification settings. am: b0877b390d
am: 84506b36c5

Change-Id: Iab1c7df7fb56b76f3dcacc13608d23bbdcfeda51
2018-04-23 19:00:53 -07:00
Doris Ling
b0877b390d Fix footer text not translated in Magnification settings.
- pass in the summary res id instead of the actual text when building
the launch bundle for the magnification settings.
- remove the title argument as we are passing the title res already,
which takes precedence.

Change-Id: I4ba624e1d9722aa980ea94c306df9a015a159555
Fixes: 78126057
Test: run i18nscreenshots
2018-04-23 17:07:32 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Matthew Fritze
e2d07ea458 Merge "Add A11y Slices" into pi-dev am: bc4c392ff4
am: c82cf95105

Change-Id: Iabff6994e9a4eb67d2702eb949f6e60939db0508
2018-04-17 18:54:46 -07:00
Matthew Fritze
a711ed8330 Add A11y Slices
Add AccessibilityPreferenceController, which wraps all a11y settings
since they are share common infrastructure for enabling, current value,
and availability.

We add an overlay for OEMs to declare their bundled a11y services.
This is the only list of services that will be possible to enabled via
Settings slices.

Accessibility Slices are built by getting a list of valid services,
and indexing the service names as a key in the Slices DB. When they are
built at runtime, they use the generic A11yPrefController to get the status
and enable/disable the service.

Bug: 67997836
Bug: 67997672
Test: robotests
Change-Id: I66f905bf1c55eecb937945c4675c12bcbc96d698
2018-04-17 10:27:02 -07:00
Fan Zhang
0cd2ccfe30 Create help link placeholder for Wifi Direct settings.
Change-Id: Ia22259d191d2663d7ef63438c680826d3fd590fb
Merged-In: Ia22259d191d2663d7ef63438c680826d3fd590fb
Fixes: 70854725
Test: robotests
2018-04-06 23:06:36 +00:00