- Added new metadata allowing to set PendingIntent onto a Tile, which will be executed on click;
- Update the rendering logic to render with SwitchPreference only when Tile.hasSwitch() == true.
Test: robotest, manual
Bug: 281517110
Change-Id: I1253029be1e172792679f80be24bd58e368b9e73
* AbstractPreferenceController now can implement OnActivityResultListener to receive callback from DashboardFragment#onActivityResult()
Bug: 270096758
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.dashboard.DashboardFragmentTest
Change-Id: Ib734287c6fe06fcdde3b2fe6ae9f4b778020b60b
When an account is added or removed, the account preference controller
just updates the account list, whereas there's no trigger point for the
account data sync preferences to refresh.
Add an API to update all preferences in DashboardFragment, so we can
refresh the account sync preferences whenever the account list is
updated.
Bug: 185479221
Test: robotest, manual
Change-Id: Ide3d972abae09ce0175e3bafbb1f4a5e307d20c8
The injection dynamic data was loaded in the background and then post to
main thread to update UI. However, it usually updates after
Fragement.onResume(), which causes the flicker.
To make it more smooth, DashboardFragment to wait for the dynamic data
observers to update UI for a short period, which eliminates the flicker
in most cases.
Also skip the repeated tiles refresh called by onCategoriesChanged in
onResume after all preferences refreshed.
Test: robotest, visual
Bug: 229177114
Change-Id: I04650af9692703f1fc1e6e5ad2090f051b1eeb81
We determine if the visibility should be updated by mIsFirstLaunch, and
mIsFirstLaunch is set to false in onStop(). This breaks the updatability
if there's a change before onStop() gets called.
So we move the value assignment to the end of checkUiBlocker() because
at that time, all blocker work should be either finished or timeout.
Also remove mIsFirstLaunch since mUiBlockerFinished can cover the
determination with the new design.
Fixes: 229565193
Test: Toggle Use Location in the location page and see the Recent used
section react accordingly.
Change-Id: Id6005e5b8b29cb8a6309068d0a2177489a3fb2f4
Controller can implements LifecycleObserver to observe the lifecycle.
Before this fix, preference controller which defined in the XML file
must implement com.android.settingslib.core.lifecycle.LifecycleObserver
(which is deprecated, and is a subclass of
androidx.lifecycle.LifecycleObserver).
After this fix, preference controller which defined in the XML file
and implemented androidx.lifecycle.LifecycleObserver will successful
observe the lifecycle.
Fix: 149338098
Test: robotest & manual
Change-Id: If9e48e44267de8e89a5e8f45d256719130936320
The existing UiBlocker mechanism doesn't support additional visibility
control. With that, controllers that want to control their own
visibility won't be able to use UiBlocker.
Fixes: 223340393
Test: robotest
Change-Id: I2df2eb1ce77e2c94bb271a8b68cc8c6004df5c70
- Creates new preferences that are shown when device-state rotation
is supported.
- Hides standard preferences when device-state rotation is supported.
- Controllers/Preferences for individual folded/unfolded rotation
settings are created and added programatically based on the settable
device states available.
Test: Manually + Unit tests
Bug: 195757480
Change-Id: I16f50fd3664756b363c7eb79e5c35eb0d3b6df17
Revert submission 16745827-device-state-auto-rotation-preferences-aops
Reason for revert: Checking if reason for test failures
Reverted Changes:
I77ed93f04:Add support for device state based auto-rotation p...
I5b2791f54:Add support for device state based auto-rotation p...
If254220ca:Add support for device state based auto-rotation p...
If254220ca:Add support for device state based auto-rotation p...
Fix: 219652963
Change-Id: Id95d5d7bb18a28403a6d3199945044e6617e0772
- Creates new preferences that are shown when device-state rotation
is supported.
- Hides standard preferences when device-state rotation is supported.
- Controllers/Preferences for individual folded/unfolded rotation
settings are created and added programatically based on the settable
device states available.
Test: Manually + Unit tests
Bug: 195757480
Change-Id: If254220ca3018bc6ec1c4e3947375733f6816f92
- Add a new highlight background drawable
- Add two homepage specific preferences for the new layout design
Fix: 207079684
Test: visual
Change-Id: I20c80da090a03129bffa845d443ee5d1ad13b97b
This reverts commit 096c090b80.
Reason for revert: crash is fixed in this change
Bug: 202510128
Test: manual, build
Change-Id: Ifff8d58cfdcf43e123b11dee308665b2617cb4b3
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
To make InputMethodPreference support 2 target
reference, CL[1] move the PrimarySwitchPreference
into SettingsLib.
Change all PrimarySwitchPreference reference to
Settingslib one and remove the original one.
[1]: Idea3935d95b8d22b00ca89313e9eb3e979e4aa74
Bug: 197705032
Test: Presubmit
Change-Id: I95d111522344bb7cbdd380382e48fe60a5ebc9a2
- Root cause: the side effect of the parallel controller loading.
- Solution: disable the parallel approach and remove the entry point
of parallel approach in DashboardFragment.
Fixes: 187838753
Test: Robo test for AppInfoDashboardFragment, ConfigureNotificationSettings,
ConnectedDeviceDashboardFragment, DevelopmentSettingsDashboardFragment,
NetworkDashboardFragment, DashboardFragment
Change-Id: If3b09c4fd6f33042e0ed38704f08e855ab8f5377
- remove the outer circle of the icons
- tint the icons including injected ones
Test: robotest, visual
Bug: 182870640
Change-Id: If72c37152f4f0d68e25149b11d497eef1c7ece91
Revert submission 13804074-controller-lifecycle
Reason for revert: ag/182373167, see a crash related to this new cl.
Reverted Changes:
I39ac69f24:Use androidx LifecycleObserver for wiring up contr...
I086620e31:Add javadoc about lifecycles for xml defined Contr...
Fix: 182373167
Change-Id: I7e6d2e9e6fd363a3afdd3dbab24e7c3b36e9ed29
DashboardFragment automatically wires up Controllers that implement the
deprecated settingslib LifecycleObserver. Now it can also work for those
that implement the androidx version. The settingslib LifecycleObserver
extends the androidx one, so existing behaviour is preserved.
Bug: 169455298
Test: manual - lifecycles work automatically for such Controllers
Test: manual - no duplicate lifecycle events for existing Controllers
Change-Id: I39ac69f24bf8577867ba3b7e56f96c5f38722a2f
We use homepage preference when it's a injected IAs on homepage
Test: See the screenshot for Google icons
Fix: 177213699
Change-Id: Ibd08ff305cdd6b556b5ceee486df01678c9212a6
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