Root cause:
Settings listens to four package-related broadcasts in order to refresh
injected items because UI data may change. However, when the system is
updating apps on the first boot, it triggers a burst of broadcasts. For
each broadcast Settings will reload and then redraw all injected items,
which leads to the flickering.
Solution:
1. When Settings recieves a broadcast, check if there are already two
reloading tasks to avoid redundant updates.
2. In the reloading task, check if any injected item is changed, added,
or removed to notify categories changed.
3. Only refresh the UI when any of the changed items belongs to the
current page.
Bug: 166785977
Bug: 168309941
Test: manual, robotest
Change-Id: I77745b60f84510554bff1870a5bb7a8013eab528
Replace WiFi related terms which contain Master wording.
Goal: Create a fixit for Android Platform to reduce the use of non-inclusive language for all code.
Bug: 161425297
Test: make RunSettingsRoboTests -j or
make RunSettingsRoboTests ROBOTEST_FILTER=DashboardFragmentTest
make RunSettingsRoboTests ROBOTEST_FILTER=WirelessDebuggingPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AutomaticStorageManagementSwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AllInOneTetherPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=TopLevelNetworkEntryPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=PrimarySwitchPreferenceTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiPrimarySwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPreferenceControllerTest
Change-Id: I9395c50e092e124016609f88f7c8151554a0d874
- Assign metrics category to perferences at an earlier stage in
DashboardFragment for better usability.
Bug: 137559984
Test: robotest
Change-Id: Icd4185efa0e655be20c4b673a1380fa42140923f
- Add interfaces to set/get metrics category in BasePreferenceController
for descendants having a chance to get it.
- Set metrics category in DashboardFragment
- Automatically log metrics in onPreferenceChange of
TogglePreferenceController
- Add support for TwoStateButtonPreference in TogglePreferenceController
to make the preference generic
Bug: 137559984
Test: robotest
Change-Id: Ia7e0d24a3db1991b18e0286d9894570fa71247a3
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
- Move the log point of onPreferenceTreeClick from DashboardFragment to
it's super class InstrumentedPreferenceFragment for better coverage.
- Write the preference click metric log in PreferenceController handling
case in DashboardFragment which will skip super class's log point.
Bug: 137559984
Test: robotest
Change-Id: I67178f613c74f755e20fc9dc41319974cb02e83c
- Add settings:forWork in xml
- Set mIsForWork based on xml attribute
- Delete WorkProfilePreferenceController and move its function to
BasePreferenceController
Fixes: 123376083
Test: Add work profile, go to Settings->System->Language&input,
UI should show work profile related items
Change-Id: Id2dcbb0e158c117cdfd363466a275f4e133c345e
- The updatePreferenceStates is called in the onResume. Here creates a new enum to
record the elapsed time.
Bug: 137558156
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.dashboard
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.core
Change-Id: I02bdbeecd61fbc0082eea19ea64cbfe7541a6970
- Use the multiple tasks to enhance the controllers loading.
Bug: 137558156
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.dashboard
Change-Id: I629ff5dc81347cddf9762a87015b9b86b6a46e50
Allow developers to inject MasterSwitchPreference, a switch
preference with two tap targets, to Settings page.
Developers should declare keyhint and switch_uri for the activity
in AndroidManifest,and then implement a SwitchesProvider.
Bug: 132808482
Test: robotest
Change-Id: I64cdf18268be0cfcd38aab2c059144536dd79b32
- use SummaryProvider to provide the summary of UserSettings
- use WifiDisplayPreferenceController to replace the summary loader
in WifiDisplaySettings
- use ConfigureNotificationPreferernceController to replace the
sumary load in ConfigureNotificationSettings
Fixes: 141653158
Test: robolectric
Change-Id: Id5f5ed645707caa0b25ecae5252174cbf017651c
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId
Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
This CL before, if controller have UIBlocker interface
will going to blocker condition to make whole page
invisible for a certain time until slice is fully loaded.
This CL add the check condition that if the controller
have UIBlocker inferface but didn't have slice uri will
not go to blocker condition.
Bug: 141292712
Test: make -j42 RunSettingsRoboTests ROBOTEST_FILTER=DashboardFragmentTest
Change-Id: I79daae131654f8fd823a9c8f1be46ad6c7921908
Create a config resource for OEMs to add suppressed tile's key, then
DashboardFragment will filter related tiles out from Settings.
OEMs can use this way to suppress security patch injected tile if they
don't use Google OTA.
Fixes: 130734771
Test: visual, robotests
Change-Id: I4cab79c8672048fa543d39b2a8f38ffe338189c8
We used to tint the injected pref icon when refreshing Tile. However,
when we are going to render the icon, we used Tile.getIcon which uses
the icon resource id to get the original version of icon directly.
Do a little refactor here to move the tinting logic inside Tile.getIcon.
Test: Manual/Visual inspection
Fixes: 129010399
Change-Id: I6f187b12cb6d91b54dcfe43e0ff34add55fd7b07
1. Don't create UiBlockerController if there is no related controller
2. Don't update visibility if UiBlockerController is null
3. Use findPreference() from DashboardFragment, which already has null
check.
Change-Id: Iee24c64317fb9d5a1cf2076d25728af485d390c5
Fixes: 122807414
Fixes: 122805831
Test: RunSettingsRoboTests
If DashboardFragment detects blocker controllers, it won't display
until:
1. All blocking controllers finish bg works.
2. Timeout
This CL adds UiBlockerController to control this behavior and
BlockingSlicePreferenceController as an example.
Bug: 120803703
Test: atest SettingsUnitTests
Change-Id: I66fc194776d46ee49b3ec7685f3167834e673ba2
- Settings crash while entering Storage, Privacy, and Accounts page,
because PreferenceGroup changed the API use from String#equals to
String#contentEquals which doesn't support null keys.
- add a null check before calling findPreference
Test: robotest
Change-Id: I121cd9e4249fbdafbc67be65a09d770603e01044
Fixes: 121116425
We do not want to wait for contextual cards in app start
instrumentation, as user can already do everything in settings without
them.
Change-Id: I57d59aa3d623bf6911972ec310d558c25e44bf14
Fixes: 117494071
Fixes: 118495692
Test: perftest
- register the advanced button expand listener and add the metrics log
when it is clicked.
Fixes: 70930626
Test: make RunSettingsRoboTests
Change-Id: Ife4af4bd4a0a8534cf9ba63949660a810b09446a
And switch to getId() instead of title when comparing 2 tiles. This is
more accurate and more efficient.
Bug: 77600770
Test: robotests
Change-Id: I587d90702d98956bf7b420529ac3280351ca4a10
And each page has ability to turn on/off rounded icons. This CL only
adds the flag, it doesn't actually change icon shape yet.
- Boolean config in xml
- New protected method for each DashboardFragment to load config
- Plumb the boolean into DashboardFeatureProvider for future use.
- Remove some unused APIs from DashboardFeatureProvider
Bug: 110405144
Fixes: 79748104
Test: robotests
Change-Id: Id34782e75aa7289967e4dd1f4fe2978688092702
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
Settings app uses fragment classes from android framework,
which is deprecated as of P.
We need to switch to use fragment and associated classes to androidx.
Because Settings didn't support drawer feature since Android O,
we rename SettingsDrawerActivity to SettingsBaseActivity.
Before we migrate to fragment of androix,
we need to let SettingsBaseActivity extend FragmentActivity.
Test: make RunSettingsRoboTests
Bug: 110259478
Change-Id: Ifbf53f75f042da1618da16cf7837b70d298a9a14
getPreferenceControllers() -> createPreferenceControllers() for the same
reason as in ag/3647936
Bug: 73668763
Test: robotests
Change-Id: I97670a91a2a38d1c844d1b9d37f4222c5e6f45a0
- If a <preference> tag also defines a controller, we will try to
instantiate it before displaying the UI. The same logic is shared by
BaseSearchIndexProvider so it also drives search suppression.
- If user also defines a list of controllers programatically, the
programatically created ones takes precedence.
Bug: 73668763
Test: WIP
Change-Id: I7aecec270bcd3af261e012ef1f6995d2a523cfa1
Previously, DashboardFragment stores preference controllers in an
ArrayMap of <Class, AbstractPreferenceController>. Thus when there are
multiple controllers of same class (ie. multiple
PreferenceCategoryControllers), they cannot be stored simultaneously.
This changes the value to a List so we can store multiple controllers of
the same Class without extraneous sub-classing.
Bug: 70949662
Test: All existing tests still pass.
Added
DashboardFragmentTest#testPreferenceControllerSetter_shouldAddAndNotReplace
and DashboardFragmentTest#updateState_doesNotSkipControllersOfSameClass.
Change-Id: I397e8c91977ea1180d48a3af75dd4058bf1175c0
When the dashboard summary is being initialized, it will rebuild the UI
while the summary loader tries to to go through the tiles to update the
summary. Both is being done on a separate backgroud thread, and it will
run into concurrent modification issue if the thread is being swapped
while one is looping through the list.
Instead of letting clients access the list of tiles directly, add a
getter method in DashboardCategory to get a copy of the list of tiles
for all read-only operations.
Change-Id: I479669abd8d1d0a8ee9a4113d8ad2244da56f4d8
Fixes: 69677575
Test: make RunSettingsRoboTests
- Put memory updates on background thread
- Prevent update state from being called twice
Bug: 69000975
Test: Manual
Change-Id: I186bc25f6b74a5098b1737891efee3a6855dc996
The logic still lives in fragment for now. They will be moved into
PrefControllers in follow-up changes.
Bug: 32953042
Test: RoboTests
Change-Id: I2b03d26b5f4e6bbb37b42f9dc83a9464eb169868
- functionality for hiding portions of the preferences in the preference
screen is added to the support lib. So, changing the settings
implementation to use the feature from the support lib instead.
- remove ProgressiveDisclosureMixin and the related code
Fixes: 63985174
Test: make RunSettingsRoboTests
Change-Id: Ib1d39b2db93d78a56c7adf90abcae5226f9564c2
1. Move getPreferenceScreenResId() from individual subclass to
InstrumentedPreferenceFragment.
2. Removed InstrumentedPreferenceFragment.getTitle() and let the
preference fragments that do not have preference screen set the activity
title directly instead.
3. Removed OptionsMenuFragment as all it does is call
setHasOptionMenu().
- changed subclasses of OptionsMenuFragment to extend from
InstrumentedPreferenceFragment directly.
- none of the exisitng subclasses actually implements the option menu
related methods to provide any option menu. So, the setHasOptionMenu()
call is not added to the subclasses.
4. Update Languages preference title.
- launch the fragment from the preference controller instead of from the
default handling, as we need the title res id at launch time to get it
work properly when retrieving the title from back stack.
Bug: 64564191
Test: blaze-bin/screenshots/android/i18nscreenshots/i18nscreenshots
Change-Id: Ibecdcab32cbaed8bf604ec5ebe0a926b4e489a7d
When determining whether to tint the tile icon, first check whether the
tintable metadata set for the tile. If no metadata set, will then follow
the default logic that tint the tile icon if it is not coming from the
Settings package.
Change-Id: Idf0863e0c6ab063aeaa6d013fa620508ced31fdb
Fix: 62473193
Test: make RunSettingsRoboTests