And move ic_a11y_generic from mipmap to drawable. IconCompat doesn't
support mipmap.
Bug: 118691898
Test: robotests
Change-Id: I6799f3d31d2c5654319e5a97bf8ca14992e785a7
Remove spy context syntax because we do not need to
mock context anymore in the test cases.
Bug: 117644158
Test: robotests
Change-Id: I222eec4fbc1994d7bb79adead40b76ac0a000bdc
For now, slice view shows screen title by default,
but it isn't approprate for some simple cases.
ie, device model, phone number, android version etc.
So, We create a new attribue which let BasePreferenceController
be more flxible. User can choose what they want to show
in summary text.
Fixes: 74900516
Test: make RunSettingsRoboTests
Change-Id: I2788c6edfaf8e656170a507607f22513841a3e0a
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
Currently, when a Settings Slice dosen't have an icon, we add an IconCompat
object with the resource 0x0 - which gives an empty icon. This is from the UX
direction that we should only have icons for Settings Slices when the
corresponding Settings have icons in the Settings UI.
However, this causes an issue with a recent change to SliceView, which crashes
the UI when a Slice is rendered without an icon. Previously, the icon code path
was only exercised when the Slice Shortcut view was being used, but after the
change, the icon path is always used and thus crashes when trying to fetch a
resource with id 0x0 from Settings or another provider.
About 2/3rds of Settings Slices do not have icons.
This change adds the Settings App icon as the back-up icon for any Slice which
would otherwise not have an icon.
The impact of missing this change is:
- Settings Slices cannot be shown in launcher spaces until a post-P update comes
from the support library.
- If Settings launches with the bug, Slices cannot patch the API which would require
all Slices to have a non empty icon (b/111438616)
Bug: 111082093
Test: Robotests, Settings Search UI testing, Slice browser testing
Change-Id: I6f326b6b41bf59011a211c6340dd639f68e754e1
If a Slice cannot be changed, return null instead of
an error slice.
Bug: 80155832
Test: robotestst
Change-Id: Ib94136c449c6d9c1911f89833bba62fd2263daa4
To improve context on search surfaces where the
setting may be ambiguous, we set the screentitle
as the summary text as the top priority. If there is
no screentitle or the it matches the title, then we
try to use the controller summary. If the controller
summary is not valid, then we show nothing.
Bug: 79780762
Test: robotests
Change-Id: If4f7f8d4a072125604ede14e3df2afd667fa24b7
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.
The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.
Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.
Bug: 78910582
Fixes: 79245656
Test: robotests
Change-Id: I42c2cedab66be2d76999795f46470a079cc1ec71
Merged-In: I58821a6cfd6134b3b351657b6edf5f74ead00643
Attach the keywords used for Settings search to Slices.
Their primary use is helping match synonyms for presenters
which display slices without explicit Uri requests, like a launcher.
This changes:
- Updates database scheme
- Adds to SliceData object
- Grab keywords in the SliceDataConverter
- Set keywords on all slices
Test: robotests
Change-Id: I16c40d2380ffddaf0a87fb1b9cd58e95573b308f
Fixes: 78306195
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
When a slice becomes unavailable, it should not update the
underlying data even if the view has not changed.
When we receive a change from an unavailable slice, notifychange
on the Uri and do not change the underlying data.
Change-Id: I91851ab668e4aece669fd65c14e0dc4ec2edefdf
Fixes: 77980406
Test: robotests
Add AccessibilityPreferenceController, which wraps all a11y settings
since they are share common infrastructure for enabling, current value,
and availability.
We add an overlay for OEMs to declare their bundled a11y services.
This is the only list of services that will be possible to enabled via
Settings slices.
Accessibility Slices are built by getting a list of valid services,
and indexing the service names as a key in the Slices DB. When they are
built at runtime, they use the generic A11yPrefController to get the status
and enable/disable the service.
Bug: 67997836
Bug: 67997672
Test: robotests
Change-Id: I66f905bf1c55eecb937945c4675c12bcbc96d698
PendingIntents were being cached because they had the same
targets and would not differentiate on extras - thus all Slice
intents would go to the same destination as the first intent fired.
Adding the data stops the system from caching the intents.
Change-Id: Ifccab72ed482e22750422c5c36aa6d205c20ae3d
Fixes: 77650727
Test: robotests
In the change to mark disabled_dependent as available,
it did not change the check in SliceBuilderUtils for the
unavailable Slices. In the case of DISABLED_DEPENDENT, the
setting is available but the Slice is not.
Though it is a simple change, we can now properly test the contents
of Slices, so this change includes tests which should have been in
place earlier and would have caught this bug - duh.
Bug: 71640747
Test: Robotests
Change-Id: I8db5bc80edb337cbf907ce3669aa2bfd9c72f74a
If both Xml and a controller provide a summary,
the controller's should be prioritized.
Change-Id: I030746b0f253ce4884a7868e385069b208f63082
Fixes: 77602860
Test: robotests
When an inline slice is requested, and the setting is unavailable,
we should present more useful information to the user. This CL handles:
- Unsupported: return intent slice to Settings home page
- Disabled for user: intent to the setting page
- Unknown reason: intent to setting page
- Disabled dependency: Create intent-based Slice rather
than the requested inline slice.
Bug: 71640747
Test: robotests
Change-Id: I9c1a0ee36119d4f9f3b205e0824c251f4356db55
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
Return CharSequence instead of String.
All user visible string should be modeled as CharSequence.
Bug: 73950519
Test: robotest
Change-Id: I30befef0c33f94351d4a2774e283bd1ed804aa8b
Autobrightness preference controller was accidentally removed from
display_settings.xml. Given that no tests were broken and this would
be a disaster for phone buddy & inline actions, I have added another
test which keeps a list of valid controllers that should exist in xml.
When more inline controllers types are added, they will be included
in this test.
Fixes: 72564979
Test: robotests
Change-Id: I40fe18f9118af9cec1c201632742d2949ff64be5
To add bluetooth as a valid slice requires adding
support for Context-only preference controller
constructors, which was already planned work.
Fixes: 67997327
Test: robotests
Change-Id: I7efd20a05d5796c3327a26b1fc535d5436d1070f
Summary on slices will now determined by checking that
summaries in the following order are valid:
1) SliceData summary
2) Preference Controller summary
3) SliceData screen title
Valid is currently defined as:
- Not empty / null
- Not whitespace
- Not sumamry placeholder
Fixes: 71640678
Test: robotests
Change-Id: I5e699e8566ece80742d311617b7dc4e9a9bda8cf