According to patch of A-231987122, AOSP restricts app to modify relevant
mobile settings when user is a guest. This change intends to prevent the
slices related to mobile settings from being requested by guest user.
Bug: 278616139
Bug: 277333776
Bug: 262244832
Bug: 278616520
Bug: 278615120
Test: robotests
Change-Id: I4dc4bbfdb5cf76e188e6f62ebfd74ef6fa2fe33b
The test testLoadSlice_cachedEntryRemovedOnUnpinned was ignored in
ag/20185792 but fixed in ag/20172765
Test: manual run passed m RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.slices.*"
Change-Id: I0bd0e7f7ed780ab24500c3fb102fd216486c34d9
Bug: 253386051
- Add an interface to get highlight menu key resource in Sliceable
- Force implementing the new interface in TogglePreferenceController and
CustomSliceable at syntax level
- Update the slice index db schema
Bug: 204695404
Test: manual, robotest build pass, unit
Change-Id: I0b5068bccd04f1590023de7f3385bc0a4c6fa47b
Starting Android S, all PendingIntent should have the mutability flag
assigned to prevent from vulnerability.
Fixes: 172811605
Fixes: 172206649
Test: 1. Play on the slices in Settings search.
2. Make a permission request intent of Settings wifi slice in the
slice-viewer app, clicking on it and make sure it gets redirect to
Settings without crashes.
Change-Id: I86f915bc062a6e632b5ca9c74e232db1036f08de
- 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