- Reload theme in slice provider when Dark theme mode changes for slices
- Reload theme in onCreate of Panel activity for its non-slice header
- Remove applyTheme from individual slices
Test: robotest
Fixes: 153700819
Change-Id: I40a7d2817c4b9100d7b2f2962a69c8a9ce6f7906
A malicious app is able to obtain this pending intent.
It can then mutate all fields except for the action and
launch the intent. This can be used to launch any activity
with the ACTION_SETTINGS action.
So, we enfore assign the package name for this intent,
it only can launch the settings app.
Fix: 147355897
Test: a) Install the new settings apk, and it won't launch other screen.
(See details in bug)
b) Start the settings search, slice search results work as normal.
Change-Id: Ie954d8a4b7153d6a4cac40621f363b45185990f2
(cherry picked from commit b3c0a2a6c1)
Merged-In: Ie954d8a4b7153d6a4cac40621f363b45185990f2
Apps get Settings Slices through onGetSliceDescendants(), so adding some
codes here to make us be capable returning non-public Slices. As these
SliceData come from slice_index.db, where SliceDatabaseAccessor is the
middleman for us to access those data, so adding a parameter in
getSliceUris() to determine what data should be returned.
Bug: 141088937
Test: robotests
Change-Id: I411eb1ff194b7c8915b9e7309c684046dbde29fb
During SettingsSliceProvider#onGetSliceDescendants, use the uris from
database directly instead of getting the key and construct the uris
manually.
Bug: 126222433
Test: robotest
Change-Id: Iad4e9fc28ec4442b6bb323878503d743582b35ac
And slightly refactored the SliceDataConverter to remove 1 reflection.
Bug: 126222433
Test: robotest
Change-Id: Ic5782bdd71f5c9cb77879a35de81dc61c01d1912
SettingsSliceProvider no longer allows apps to request permission
from the user for Settings Slices. Instead, the PrimaryAction on the
permission slice will be an intent into Settings.
This is because the dialog for granting apps Settings Slices would act
as a replacement for regular permission dialogs, which we want to avoid.
Fixes: 130795282
Test: robolectrico
Change-Id: I6848215bab2bf10ee5e53814b765d04f04f53f4e
- Introduce a static long in SliceFeatureProvider that updates once
every "session". A session is when user is in an UI (screen rotation,
going to subpage, etc does not break the continuation of session).
- Use session token in ContextualWifiSlice to determine when to refresh,
instead of relying on WeakHashMap from CustomSliceManager.
WeakHashMap can be cleaned up at any time by gc so it doesn't match
what we want on the UI.
- Also as a side fix, merged CustomSliceManager into
SliceFeatureProvider.
Fixes: 123937830
Test: robo
Change-Id: I199bceceb208b99a32f3f08e624787b5a03e73a9
The NFC Slice would jank on enable and disable, because of the
intent filter it registered with SysUI. The intent filter would
broadcast an update for four states:
1) On
2) Off
3) Turning On
4) Turning off
The first two caused no problems. The third and fourth caused jank,
since when clicked, the switch in the NFC slice would turn on / off
asynchronously - that is, it turned on or off based on the previous
state of the switch, rather than on the actual value of NFC. It does
this to feel fluid in the app in which it is rendered.
From the off state, the order of events is:
1. Switch clicked
2. Switch animates on
2. Background intent is fired to settings to turn on Nfc (happens at
the same time as animation)
3. Settings calls the NFC enable API
4. A broadcast for Turning On is sent
5. The receiver in SysUI gets the broadcast and forwards it to settings
6. Settings tells the Slice to make sure it is up to date
7. The Slice checks for the current value - IMPORTANTLY - which is
currently off, it is only in the process of being enabled.
8. The Slice flips back off
9. Nfc finishes getting enabled in the background
10. The framework pushes the NFC ON broadcast
11. SysUI gets the broadcast, and forwards it to settings
12. Settings tells the slice to update
13. The slice checks again and finds that NFC is on, flipping on.
This CL creates a new background slice worker for NFC and registers
the intent filter there, rather than in SysUI. When the background
worker gets the broadcast, it checks if it is in state 3/4, and if so,
it drops the update silently.
Fixes: 115737701
Test: robotests
Change-Id: I17043828ad3a67a2a5acdf5c75d9cc51ff7e91d0
- Update conditional card layout
- move action button from right side to bottom.
- Get rid of the forking between small/big screens.
- Update a few icons
Fixes: 121189136
Fixes: 124315564
Fixes: 124316920
Test: visual
Change-Id: I205d9995a2d7ed06ad9d32f3cea74f2840a28aed
Build the special case mobile data slice for general use,
and for the Internet Connectivity Panel. The Slice controls
the default data subscription, and links to the subscriptions
page.
Bug: 117804089
Fixse: 119411534
Test: robotests & test app.
Change-Id: I31b524a8fe3182a244d940848090e97250632f39
When there is a connected wifi, we now hide the wifi slice card.
However, if we initially shows this card but later wifi is connected
while the card is visible, we keep showing this card to avoid janky
animation. The card will be gone if user nagivates to a different UI and
comes back.
- Create a new slice ContextualWifiSlice for homepage use case, all
special logic for homepage are added here.
- Change reference for WIFI_SLICE to CONTEXTUAL_WIFI_SLICE where make
sense.
Change-Id: Ibd87f88058f357aabef0f7d68a5bf48350d75b06
Fixes: 121040746
Test: robotests
The resources available to tests are now exactly the merged resources
located in the APK under test.
Bug: 74359828
Test: make -j56 RunSettingsRoboTests
Change-Id: I050db81a92decefea23314b5ec7a62f77ff4bb2b
- Create workers via reflection in SliceBackgroundWorker
- Store the workers in a static container and release then at shutdown()
Fixes: 118228009
Test: robolectric
Change-Id: I564277d3a12b2d7d3b50cef091bdfedb3397c145
It's because WifiTracker's initialization and onStop is on different
thread. Fine tune the thread logic in SliceBackgroundWorker.
Fixes: 118165942
Test: manual
Change-Id: Icc86b5df7ec3c6fd0e4a79a62ea0c84465e9528d
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
Modify the WifiSliceCode to follow the pattern for
Slices that do not match existing UI components.
Test: robotests
Bug: 80263568
Change-Id: Id69e019608777282f4b64ff945e8c30c97aaf577
Create a handler for any slice that doesn't include anything
from a PreferenceController.
Test: robotests
Change-Id: If23947152d61877537d0cac6240e96b9ab977bce
Bug: 80263568
- It retrieves the flashlight status from Settings.Secure.
- It uses the broadcast relay to update flashlight status
without action on the slice.
Test: robotests
Change-Id: Ib4d636541f5166b8634326cce76aed5665989b76
Fixes: 74913192
1. Use real BluetoothAdapter instead of settingslib version. The
settingslib version contains calls that violates strictmode rules.
2. Override StrictMode rules in SettingsSliceProvider when it's called
in background thread. When in background, the enforcement from Slice
framework (StrictMode#ThreadPolicy) is not useful and can be safely
ignored.
Change-Id: I68523148f4c1dc88a54e207447d21ec439478cdf
Bug: 79985175
Test: robotests
Bluetooth slice is added a special case, due to the migration of
bluetooth to a Switch Bar instead of a preference with a controller.
Change-Id: I8b70bb66c862255a4e8d2426ac09939ba6197624
Merged-In: Icfdcd77601ad1e64e0f6c352a8d691f0181515c8
Fixes: 67997327
Test: robotests
For settings which can change in the framework, outside of
the settings app and a slice, a Slice needs to be able to
register a listener for these changes.
Adding a getter for an IntentFilter in BasePreferenceControllers
allows us to use the SliceBroadcastRelay in SysUi to listen for
these changes.
Test: robotests
Fixes: 78138654
Change-Id: I579375069ca98fd21b60cd3a69c1a122cabf96e2
Merged-In: Ifa05b651aaa3458c54866f71469964b1a070e458
Add DND Slice as a special case, since there is an existing
inheritance structures in the zen mode preference controllers which
would be too risky to change at this point in the release.
Change-Id: If4b7013be35c89695786af2dbbea2edcf7a189f3
Merged-In: Ice608b9a7bd6f38b73e581eb3723f0a2fae96f2b
Test: make RunSettingsRoboTests
Fixes: 67997377
Add a custom Wifi Slice to the Settings Slice Provider.
It needs a custom Slice because of the complicated listener logic
in the MasterSwitchPreferenceController, which makes it hard to
work-in synchronous set/get logic.
The one-off Slice requires extra changes, including:
- Including it in getDescendants
- Handling changes to wifi by the framework
This is the first change that uses SettingsLib's broadcast relay,
which allows settings to (un)register IntentFilters to a Uri,
allowing Settings Slices affected by the framework (quicksettings,
connectivity related, volume, etc) to be updated without action
on the Slice.
Fixes: 70622039
Fixes: 67997332
Test: robotests
Change-Id: Ia76738dd6baacd5522d52df2c61ebad86a600282
Merged-In: Ibfe4736beecb833e3f6bb871b2eb5228a5fd3a34
Previously if there were multiple clients it would trigger an infinite
loop as the cache gits dropped after the first bind, and the second
client would trigger another load. Instead now cache as long as slices
are pinned since thats the intended behavior of caching.
Test: make RunSettingsRoboTests
Change-Id: I7d29fab87573120b34cd55e1696c4c5b70fc891c
Fixes: 78471335
getDescendants allows another app to collect a list
of all valid Uris for Settings Slices. Important for search,
assistant or launcher apps.
This means searching our database for all valid keys and building
a list of Uris for each of those keys.
Fixes: 77808328
Test: robotests
Change-Id: I3ae27e4661a7dcaab50b091ae2730013118af8a2
Extend slices_index.db to include SliceType and platform flag.
This will be used when we generate a list of all available slices
for different authorities & separated intent/action paths.
Bug: 62807132
Test: robotests
Change-Id: I1cce49d077c02ab79153db9bfdfc894dbab5e16a
Create the notion of an official platform slice.
This includes:
- Adding a second authority to the provider
- tagging slices in xml with a platform slice flag
- Including authority in the getUri method
Bug:73359139
Test: robotests
Change-Id: I5382be138a262dbc5a8324c34aab131c5d0d5516
Merged-In: I581ee6dfcdf935f452a15e89e5d055e375ff1877
This allows Settings to test against the latest framework changes.
Also replaced TestConfig with traditional robolectric.properties.
Bug: 73173204
Bug: 73892008
Test: make -j56 RunSettingsRoboTests
Change-Id: I3135b4fa5f095ba79b282a76f45dd9baa2584bc7