Commit Graph

25 Commits

Author SHA1 Message Date
Jason Monk
f778a91a88 Merge "Add auto-granting of slice permissions" into pi-dev 2018-04-26 22:05:19 +00:00
Jason Monk
fcd5f0f1aa Push full slice index to device index
Test: make RunSettingsRoboTests
Bug: 74555610
Change-Id: I3f0aa1218e1d7e736dc918d83e76423fa81ac6ab
2018-04-26 11:16:04 -04:00
Jason Monk
4913183def Fix settings slice caching
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
2018-04-24 17:08:26 -04:00
Jason Monk
0ef0c367e9 Add auto-granting of slice permissions
Allow things that can read the index to access slices too.

Test: existing tests unaffected
Bug: 77313888
Change-Id: I54c4b89eefb4354aa6b7dcafb7ac09dc96cbdbeb
2018-04-23 18:42:21 -04:00
Jason Monk
28af23680e Fix wifi launch intent
Test: manual
Bug: 76162313
Change-Id: Ie4d4235026ed72afc68f0e513ec34c8f188badb9
2018-04-18 10:54:35 -04:00
TreeHugger Robot
bc4c392ff4 Merge "Add A11y Slices" into pi-dev 2018-04-18 01:44:58 +00:00
Matthew Fritze
6730a061b1 Add getDescendants to Settings Slice Provider
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
2018-04-17 10:48:53 -07:00
Matthew Fritze
a711ed8330 Add A11y Slices
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
2018-04-17 10:27:02 -07:00
Jason Monk
20210122bd Updates to match prebuilts drop
Test: build
Bug: 77482321
Change-Id: I65a2cffb0a921ef6acb58ff500a7da8a8f870e76
2018-04-04 16:08:17 -04:00
Matthew Fritze
fcdfc2d83f Return back-up slices for unavailable settings
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
2018-03-23 12:47:36 -07:00
Jason Monk
f6edc7c80a Add option for settings to push to a device index
The index implementation is optional and left up to the OEM.

Test: Open settings, see content in index
Test: robo tests
Bug: 68378569
Bug: 76102600
Change-Id: Idb8bb1e0cabbbe92e7a852e2eadbdcd8c2ab7d56
2018-03-23 09:36:57 -04:00
Matthew Fritze
ad6678f9fc Add Slider template for Slices
Add the Seekbar preference equivalent
to the TwoStatePreference (toggle) preference
controller abstract controller.

Change-Id: I6ff91f2f72a7f72c18ddbc27b2b1fda4b6ce6ca9
Fixes: 67996707
Test: Robotests
2018-03-22 11:46:47 -07:00
Alan Viverette
4734b3448a Restore "Update for 1.0.0-beta1"
This reverts commit b4fe52343c.

Bug: 74950017
Test: manual
Change-Id: I9749b9ae8f2f75b1bbdf7c6686a036db1f6f8a74
2018-03-16 02:13:11 +00:00
Alan Viverette
b4fe52343c Revert "Update for 1.0.0-beta1"
This reverts commit 6b1fd5cfa9.

Reason for revert: broke Settings

Bug: 74950017
Test: revert only
Change-Id: If56a4dcac4671d8e2c5f2c0de30d13e3cf58666a
2018-03-15 18:48:00 +00:00
Alan Viverette
6b1fd5cfa9 Update for 1.0.0-beta1
Bug: 74449147
Test: make
Change-Id: I664b5f29efbb5d6c40420c0d8aaa8629ddfcd31b
2018-03-12 23:08:35 +00:00
Matthew Fritze
a4a3dfffa2 Declare official platform slice
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
2018-03-09 18:04:06 +00:00
Alan Viverette
24ac51ce3a Revert "Revert "Update to match now slice APIs""
This reverts commit 80c806abd6.

Bug: 73250914
Test: make && make checkbuild, manual testing
2018-02-27 22:12:02 +00:00
Alan Viverette
80c806abd6 Revert "Update to match now slice APIs"
This reverts commit 2d96005aba.

Reason for revert: prebuilt revert

Bug: 73903252
Bug: 73876473
Bug: 73875529
Bug: 73866916
Change-Id: I5d47a7c5ddebc16c1c508f5bb48ace809cbaf273
2018-02-27 22:07:12 +00:00
Jason Monk
2d96005aba Update to match now slice APIs
Test: make
Change-Id: Ie74e1b179f80e1d0faf259bd22b3ae4e953a0726
2018-02-22 16:33:51 -05:00
Matthew Fritze
64aa50c006 Add bluetooth as a supported Slice
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
2018-01-23 16:16:28 -08:00
Matthew Fritze
0cb918a1de Asynchronously load SliceData from SliceProvider
The slices paradigm is to return a slice as soon as possible
whith whatever information is currently available. Then, load the
longer information in the background and broadcast on the Uri when
the changes are ready.

This CL incorprates a cache system for SettingsSliceProvider to
load that data in the background to solve the issues of multiple
simultaneous callers.

Bug: 67996923
Test: robotests
Change-Id: I0e3f9984181e1c989fed139707cdb27956cf6de6
2018-01-17 16:31:58 -08:00
Jason Monk
5ef0a604a9 Follow slice refactor
Test: make
Bug: 68378561
Change-Id: Ifb35d39e54b2c292017b7866d7a52b120b4f6685
2018-01-12 09:19:14 -05:00
Matthew Fritze
8c96843fe3 Build slice from indexed data in SliceProvider
Connect the SliceIndexing data to the SliceProvider,
such that a query to SliceProvider can build a Slice
via the indexed data from SlicesIndexingManager.

We take the key from the Uri supplied to the SettingSliceProvider
and find a potential matching row in the indexed data. The
matched data is then used to Build a slice for the caller.

Bug: 67996923
Test: robotests
Change-Id: If51bfd1a05c3f3817ae720554f95a98fc7b002e1
2018-01-10 10:58:33 -08:00
Mady Mellor
ca5304413a Update settings slice provider to use new API
Test: build with new API
Change-Id: I2513b23166848d7729547dc56987766aab48b016
2017-12-15 11:36:42 -08:00
Matthew Fritze
7fddfebf6c Add Slices Data object and DB Contract
Add in a Data object used to represent one row
in a new SQLite database used for building Slices.

The database has the following schema:
- Key
- Title
- Subtitle
- Screentitle
- Icon
- Fragment
- Controller

The key is the preference key.
Title, subtitle and Icon are for UI info.
Screentitle and fragment are for the intent.
Controller is used to get dynamic ui info (like summary),
and to take actions on the slice (like a toggle).

The actual indexing and a Slice will be handled in a subsquent CL,
but a prototype can be found here: ag/3324435

Test: robotests
Bug: 67996923
Change-Id: Id91deb58a3ab89ce1dab5a3f34cdb9ade6263aa8
2017-12-13 10:59:47 -08:00