Commit Graph

168 Commits

Author SHA1 Message Date
shaoweishen
c08aad0ab4 [PK Setting] add keyboard review under keyboard selection page
Demo video as attached in bug.
Add new image view for keyboard layout review.
Reuse NewKeyboardLayoutPickerController under
NewKeyboardLayoutPickerFragment when get update for keyboard layout, get
preview image from inputManager and set to the view.

This feature will be guided with keyboard_layout_preview_flag, if the
flag is off, preview image from InputManager will be null.

Bug: 305588594
Test: Verified on device
Change-Id: Ic6f8e469d3cf7114dab6935304706ad42bf83608
2023-12-14 06:44:07 +00:00
Michal Brzezinski
ef696934b0 Focusing on item highlighted coming from search result
There are two cases that require different approach:
1. No scrolling or only a bit of scrolling is required to reach desired
   item - then we can focus the item straight away.
2. We're still scrolling when highlighting is started - after
   DELAY_COLLAPSE_DURATION_MILLIS + DELAY_HIGHLIGHT_DURATION_MILLIS.
   Then we need to wait till we reach the element/stop scrolling and focus
   afterwards.

Test: case 1: search for any setting, press enter and see if keyboard is focused
on search result
Test: case 2: search for setting that requires a lot of scrolling, e.g.
"display cutout" and see if it's get the focus after selecting
Fixes: 307902050

Change-Id: Ifa0738748184e78074099e33e09e5d8df198177e
2023-11-16 18:23:58 +00:00
Elliot Sisteron
4688f3f642 Fix entrerprise strings replacement for Safety Center.
In ag/20641184, it looks like we changed the behavior to only replace
titles when in fact some strings were replacing the summary.

This causes some entries to have the summary as the title instead.

Bug: 283743216
Test: Manual
Change-Id: I7157fd04c32eebd89bdb825ccc3e8ef73c9075bf
2023-08-01 17:43:43 +00:00
Jonathan Scott
b7f4f56cad Add missing settings strings.
Also re-enable and fix tests.

Test: manual
Fixes: 226183482
Fixes: 218799125
Fixes: 219375624

Change-Id: I9605f1f4e2e834baf63e015e96639567c5481b5f
2022-05-05 09:12:59 +00:00
Tsung-Mao Fang
07dd833a6a FRP bypass defense in the settings app
Over the last few years, there have been a number of
Factory Reset Protection bypass bugs in the SUW flow.
It's unlikely to defense all points from individual apps.

Therefore, we decide to block some critical pages when
user doesn't complete the SUW flow.

Test: Can't open the certain pages in the suw flow.
Fix: 200746457
Bug: 202975040
Fix: 213091525
Fix: 213090835
Fix: 201561699
Fix: 213090827
Fix: 213090875
Change-Id: Ia18f367109df5af7da0a5acad7702898a459d32e
2022-01-05 12:10:00 +08:00
Jason Chiu
29a09e55ba Revert "Revert "Support highlightable Settings homepage menu for 2-pane""
This reverts commit 096c090b80.

Reason for revert: crash is fixed in this change

Bug: 202510128
Test: manual, build
Change-Id: Ifff8d58cfdcf43e123b11dee308665b2617cb4b3
2021-10-12 09:32:07 +00:00
Greg Kaiser
096c090b80 Revert "Support highlightable Settings homepage menu for 2-pane"
This reverts commit 9037ceabd3.

Reason for revert: Presumed cause of b/202510128

Change-Id: I0daaab95d9bc57229c0c8c916cbe3ada7aafb6fa
2021-10-08 14:29:06 +00:00
Jason Chiu
9037ceabd3 Support highlightable Settings homepage menu for 2-pane
1. Add a preference group adapter to perform highlighting
2. Add a class for mapping highlighable menu keys and preference keys
3. Add an API to determine if the screen is in split mode

Bug: 199017944
Test: manual, build
Change-Id: I8e3fe5fb96480a31ee0f3b3afb6ad78999d3d2bc
2021-10-08 12:52:52 +08:00
Yanting Yang
863d2e50e7 Remove silky flag for searching and help menu
Bug: 183670633
Test: robotests
Change-Id: Ia62936e9f48a111ab36d74b852ec04090e42039a
2021-06-02 16:49:27 +08:00
Bonian Chen
6a4d7b65d0 Merge "[Settings] Support getSystemService(Class<T>)" am: 513da92357 am: 5734490d23 am: 8cd695efea
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1639943

Change-Id: I905f9d1646a9d9ea70e42c4b5368ff983611bee3
2021-03-23 13:52:46 +00:00
Bonian Chen
49cdb602ea [Settings] Support getSystemService(Class<T>)
Add getSystemService(Class<T>) to align the capability with framework
part.

Bug: 179640862
Test: local
Change-Id: I278951c2402aa8551cee37923f45626ab1830dd3
2021-03-17 13:32:32 +08:00
Tsung-Mao Fang
ef87755c34 Fix the higlighted settings not work properly from search
Since the Andorid S, we introduce the CollapsingToolbarLayout
, the highlighted funcation might break for unkown reason.
I observed that broken cases with overlapping issue on tool bar.
The possible root cause is the interation bwtween
CoordinatorLayout v.s CollapsingToolbarLayout v.s Recycler
view.

This cl is definetly a workaround to prevent this issue.
I try to collapse the tool bar with an animation before
we start to scroll the list. This makes the overall transition smooth
but always collapse the tool bar.

Fix: 177968297
Test: Click a lot of search results, and screen should highlight
settings correctly.

Change-Id: Id9c32b642433dcc39c179a2cc83a06e77cc47888
2021-02-24 16:46:08 +08:00
Yanting Yang
47e0556e98 Revert "Workaround Wi-Fi Settings NullPointerException"
This reverts commit 99eb12048c.

Reason for revert: Revert this workaround since the real solution has been submitted and released. More information please see b/177766209.

Change-Id: I566194ff71bb9e912407d6d4b3798adc6be71779
2021-01-20 16:41:36 +00:00
Weng Su
99eb12048c Workaround Wi-Fi Settings NullPointerException
- Add null pointer checking to avoid unexpected crash.

Bug: 177782266
Test: manual test
Change-Id: I2d9ce1777adbc80bb6c40b7bb830de12bb0a9748
2021-01-18 08:54:23 +00:00
Mill Chen
14cfd2f2ca Add CollapsingToolbarLayout for sub settings
Settings app is planning to make toolbar collapsible for next
Android release. This CL is to add a new layout for
CollapsingToolbarLayout in the Settings app and to update the theme
correspondly. This feature will be controlled by feature flag, which
makes Settings app compacitible with the existing layout.

Bug: 174451673
Test: manul test and visual verification
1) Enable the feature and open Settings app
2) Navigate to each sub page and check if toolbar is collapsible

Change-Id: Ibef524bbaa7ae3f0a43db7e40e599f42e009437f
2021-01-11 18:30:20 +08:00
Arc Wang
04854f8234 [Wi-Fi] Fix exception when WifiTracker2 callbacks to Wi-Fi Settings
When WifiTracker2 callbacks to Wi-Fi Settings, should check if the
activity is finishing at first.

Bug: 151677440
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiSettings2Test
Change-Id: I95737eae3f67e6471c75ba845b57af2d721d5d37
2020-03-20 18:02:02 +08:00
Bonian Chen
1b9bda3b05 [Settings] Avoid rendering hidden preferences
Under dashboards with expand button, preferences are renderred even
not been expanded.
Avoid from rendering un-expanded preference can improve the performance
of dashboard display.

Bug: 141833767
Test: manual
Change-Id: I00c6f827a0b7b7cec6a6fd8c809b94ca1dce88bb
2020-02-11 20:52:31 +08:00
Raff Tsai
988a912237 Modify preference_list_fragment to support tabLayout
- Remove buttonBar because it is only used in PublicVolumeSettings
- Add tabLayout in preference_list_fragment.xml

Bug: 141601408
Test: manual
Change-Id: Ieb84ccf2e685a03abec7b07cb8f9f4b64ee475e0
2019-11-13 17:37:59 +08:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Sunny Shao
bf4349733d Clean FooterPreferenceMixin and FooterPreferenceMixinCompat
Fixes: 124129485
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.core
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.SettingsPreferenceFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.bluetooth
Change-Id: I920d0de403b9c7109de0e2e53be7ed99bc8e7390
2019-09-04 13:54:19 +08:00
Jason Chiu
cfa36dbaeb Fix double divider in Apps & notifications page
- The second divider is shown after we set a background to the pinned
  header.
- Fix it by simply hiding the pinned header instead of its inner views.

Fixes: 133231218
Test: robotest, visual
Change-Id: I53add6f01930299425ce96d23350f9f066e85145
2019-06-13 18:23:37 +08:00
Yanting Yang
70a8e313f2 Fix talkback issue of header preference
Header preference was just a static preference and used LayoutPreference
to show customized layout. But Preference default enabled the selectable
attribute, then caused the a11y service to speak out "Double-tap to
activate". Override the selectable attribute to fix it.

Fixes: 132856214
Test: robotests, visual
Change-Id: Ibc577de347edb66ab9de53f6177ca068a19ffa74
2019-05-22 16:38:50 +08:00
Doris Ling
fe5259493d Hide the SelfAvailablePreference if it is not available.
- instead of removing it from the preference screen, set its visibility
to false, so that if it becomes available later, it will still be found
on the screen.

Bug: 119838520
Test: make RunSettingsRoboTests
Change-Id: Idc7079bb5846aef247dd87c0b0dba2546f2d8f8f
2018-11-27 14:58:55 -08:00
tmfang
dce94bb237 Use SettingsLib's LayoutPreference
- Remove LayoutPreference in Settings source code.
- Remove unused style, layout
- Replace old imports to com.android.settingslib.widget.LayoutPreference
- Replace old XML tag to com.android.settingslib.widget.LayoutPreference

Test: robotest, manual test
Bug: 120005054
Change-Id: I9ae1ae14a16f443e11ac5d75b6038c7c5e253844
2018-11-27 13:12:53 +08:00
tmfang
d5405cf49d Fix InstantiationException on fragment
Since we overrided the empty constructor,
it can't find a empty constructor when
Fragment tries to instantiate a fragment
in framework.

So, we can't override this constructor,
and then just use newInstance() to initialize
and setup a new Fragment.

Test: robotest
Change-Id: Ifcd1c1771bc69d947caeee5c5bc055c4f94365c2
Fixes: 115676209
2018-10-17 04:20:09 +08:00
Fan Zhang
ff6f6f6991 Merge "Clean up: delete unused methods" am: 41f9566da8 am: b371dea0cb
am: 88cbe51f27

Change-Id: Ib166230d692cc7a3973355239161ed88ffd6af60
2018-09-12 17:44:52 -07:00
Fan Zhang
b371dea0cb Merge "Clean up: delete unused methods"
am: 41f9566da8

Change-Id: I973b289c688c04c00f70a6c0ba15a5b205d6633a
2018-09-12 17:12:54 -07:00
Fan Zhang
409a5f8c98 Clean up: delete unused methods
Test: rebuild
Change-Id: I144ebbdaf137ee091af949a9e38f68d02941f705
2018-09-12 13:08:15 -07:00
Fan Zhang
de117046ad DO NOT MERGE Import clean up.
Reordered all imports according to Android codestyle.

Test: rebuild
Change-Id: I750f01f70f2114d51838bf652833aebdc4065c98
2018-09-04 13:54:46 -07:00
Aurimas Liutikas
03fcde338b Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
Merged-In: I941dea40562170649bf056e675cc32e5163c0e39
(cherry picked from commit a290b873d0)
(cherry picked from commit b1af85d155)
2018-08-28 16:35:52 -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
Aurimas Liutikas
b1af85d155 Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
Merged-In: I941dea40562170649bf056e675cc32e5163c0e39
(cherry picked from commit a290b873d0)
2018-08-28 11:48:56 -07: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
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
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -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
Jan Nordqvist
9eb43ddddf Fall back to Wi-Fi data display in data usage screen with no SIM.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I06bf78e54119819be87e15baca7e5b6a241958cb
2018-04-05 07:58:23 -07:00
Jan Nordqvist
cd3f9e2a5e Fall back to Wi-Fi data display in data usage screen with no SIM.
Bug: 70950124

Test: manual
Test: make RunSettingsRoboTests
Change-Id: I06bf78e54119819be87e15baca7e5b6a241958cb
Merged-In: I06bf78e54119819be87e15baca7e5b6a241958cb
2018-04-04 15:58:53 -07:00
Fan Zhang
3befdd2c54 Merge "Fix search highlight" 2018-02-20 23:38:46 +00:00
Fan Zhang
72456a9ea6 Fix search highlight
- Fragments should not have advanced button when coming from search.

Change-Id: I10a192216b7ff702e73b791acbcc1eb1d71cb407
Fixes: 73348428
Test: robotests
2018-02-20 13:19:26 -08:00
Fan Zhang
b1d6c76b53 Migrate more settings to SubSettingLauncher
Bug: 73250851
Test: robotest
Change-Id: Ifc27b90d68bf4a907f169e19338e9b52ea5f9922
2018-02-18 21:10:03 -08:00
Fan Zhang
a10004661c Fix NPE when instantiating SettingsPreferenceFragment
Change-Id: I3997d6436f358b802dff9be307c36031f4351ab4
Fixes: 72868191
Test: robotests
2018-02-02 12:18:39 -08:00
Fan Zhang
3d516e7607 Highlight row (instead of ripple) when come from search.
- Moved HighlightableAdapter to its own class
- Replaced ripple with blue background
- Bluebackground only stays for 5 seconds. After that it's replaced by
  ?attr/selectableBackground

Misc fixes.

- Fix NPE in UserSettings
- Update char limit on a new string

Change-Id: I4687e54e71fd7b9243f520b7630563df58be23d4
Fixes: 71715698
Fixes: 72761974
Test: robotests
2018-02-01 12:35:25 -08:00
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08:00
Fan Zhang
681a4cdd47 Add search menu to all pages
Change-Id: I0910df3d26fe583deb70d7052bde28b64e7844a7
Fixes: 68814716
Test: robotests
2017-11-30 10:43:18 -08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Doris Ling
9ff1d79ef6 Expand all preferences when launch from search.
- when the fragment is created, checks the argument to see if the extra
fragment arg key is set. If so, do not hide the preferences in the
preference screen inside the advanced button.

Change-Id: I80fa20672024fe702ed2ddab448232bdc92ce05f
Fixes: 68988454
Test: make RunSettingsRoboTests
2017-11-13 13:43:17 -08:00