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
This commit is contained in:
@@ -50,6 +50,7 @@ public class SlicesDatabaseAccessor {
|
||||
IndexColumns.PLATFORM_SLICE,
|
||||
IndexColumns.SLICE_TYPE,
|
||||
IndexColumns.ALLOW_DYNAMIC_SUMMARY_IN_SLICE,
|
||||
IndexColumns.UNAVAILABLE_SLICE_SUBTITLE,
|
||||
};
|
||||
|
||||
// Cursor value for boolean true
|
||||
@@ -167,6 +168,8 @@ public class SlicesDatabaseAccessor {
|
||||
cursor.getColumnIndex(IndexColumns.ALLOW_DYNAMIC_SUMMARY_IN_SLICE)) == TRUE;
|
||||
int sliceType = cursor.getInt(
|
||||
cursor.getColumnIndex(IndexColumns.SLICE_TYPE));
|
||||
final String unavailableSliceSubtitle = cursor.getString(
|
||||
cursor.getColumnIndex(IndexColumns.UNAVAILABLE_SLICE_SUBTITLE));
|
||||
|
||||
if (isIntentOnly) {
|
||||
sliceType = SliceData.SliceType.INTENT;
|
||||
@@ -185,6 +188,7 @@ public class SlicesDatabaseAccessor {
|
||||
.setPlatformDefined(isPlatformDefined)
|
||||
.setSliceType(sliceType)
|
||||
.setDynamicSummaryAllowed(isDynamicSummaryAllowed)
|
||||
.setUnavailableSliceSubtitle(unavailableSliceSubtitle)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user