Commit Graph

13 Commits

Author SHA1 Message Date
Fan Zhang
b1b07e2030 Convert xml based API allowDynamicSummaryInSlice to java
- Add boolean useDynamicSliceSummary() in Sliceable interface. This is
  the switch equivalent to android:allowDynamicSummaryInSlice in xml. It
  moves the setter closer to regular Sliceable APIs, thus less easily to
  miss.
- Coverted all android:allowDynamicSummaryInSlice to use the java API.
  - Except 2 prefs in my_device_info. They incorrectly set this to true
  previously (controller is not sliceable, no point setting
  dynamicSliceSummary to true. They just won't do anything)

Fixes: 128446156
Test: robolectric
Change-Id: Ic57acd590dec3e87dcf4592df137321d14b854d9
2019-04-01 12:39:30 -07:00
Console Chen
ce16d7ad63 Adding the ability to customize the subtitle on an unavailable slice
When a slice is depending on some setting and the setting is off,
it shows "depends on another setting".
Add an new attribute for Preference to customize the subtitle when
a slice is unavailable.

Bug: 118399193
Test: Robo test on com.android.settings.slices, com.android.settings.core
Change-Id: I84a8400295b36abb357e5baf98e9be3a8d6ea897
2019-01-08 19:23:04 +08:00
tmfang
8eb46b717e A new attribute which can show the dynamic summary
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
2018-09-26 17:48:12 +08:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Matthew Fritze
04926f35b7 Merge "Add keywords to Slices" into pi-dev am: 2f911e2e9e
am: 21521826d9

Change-Id: I38d9efabcdecf3c40f1af28ecd167e58c2586ca7
2018-04-20 20:27:02 -07:00
Matthew Fritze
47a44e8fa4 Add keywords to Slices
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
2018-04-20 14:50:55 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Matthew Fritze
79c6395295 Index SliceType and Official Platform flag
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
2018-03-19 14:51:31 -07:00
James Lemieux
99d10a4e62 Adopt robolectric 3.6.1
Bug: 71596155
Test: make RunSettingsRoboTests
Change-Id: I46362bae1e3ddd3ce19ade1c93250d272f3366e6
2018-01-12 13:49:29 -08: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
Matthew Fritze
13c43f1900 Index Data to build Slices in Settings
The indexing is done by taking the indexable fragments from
search, grabbing their XML via SearchIndexableResources, and
then looking for controllers defined in preferences.

For each controller found, we take the combination of the
fragment providing the XML and the Preference info to create
an indexable row.

Buiding a Slice will be handled in a subsquent CL, but a
prototype can be found here: ag/3324435

Test: robotests
Bug: 67996923
Change-Id: I48668618079bcc3da55ab77b7323ee8e467073af
2017-12-19 09:47:07 -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