Add mode names to search results dynamically.

The resulting search result takes the user to the modes aggregator page.

Flag: android.app.modes_ui
Bug: 332937523
Test: ZenModesListPreferenceControllerTest, manual with modes_ui on and off
Change-Id: I7372307cb995667f6f7234530a3140f5295ab06a
This commit is contained in:
Yuri Lin
2024-05-15 13:25:54 -04:00
parent 1b1c159d9f
commit fdb948df20
3 changed files with 193 additions and 5 deletions

View File

@@ -17,6 +17,7 @@
package com.android.settings.notification.modes;
import android.app.AutomaticZenRule;
import android.app.Flags;
import android.content.Context;
import androidx.annotation.NonNull;
@@ -55,6 +56,11 @@ abstract class AbstractZenModePreferenceController extends AbstractPreferenceCon
return mKey;
}
@Override
public boolean isAvailable() {
return Flags.modesUi();
}
// Called by the parent Fragment onStart, which means it will happen before resume.
public void updateZenMode(@NonNull Preference preference, @NonNull ZenMode zenMode) {
mZenMode = zenMode;