Add custom dnd pages for each dnd auto rule
- Fix strings - Add zen custom settings dialog when custom settings are being applied Test: make RunSettingsRoboTests -j40 Bug: 111475013 Fixes: 120787133 Fixes: 120796642 Fixes: 120865472 Change-Id: I34d6b4b23d36277e3704416d65e2418418c124e1
This commit is contained in:
@@ -26,7 +26,11 @@ import android.provider.Settings;
|
||||
import android.provider.Settings.Global;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.dashboard.RestrictedDashboardFragment;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
|
||||
abstract public class ZenModeSettingsBase extends RestrictedDashboardFragment {
|
||||
protected static final String TAG = "ZenModeSettings";
|
||||
@@ -121,4 +125,20 @@ abstract public class ZenModeSettingsBase extends RestrictedDashboardFragment {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void updatePreference(AbstractPreferenceController controller) {
|
||||
final PreferenceScreen screen = getPreferenceScreen();
|
||||
if (!controller.isAvailable()) {
|
||||
return;
|
||||
}
|
||||
final String key = controller.getPreferenceKey();
|
||||
|
||||
final Preference preference = screen.findPreference(key);
|
||||
if (preference == null) {
|
||||
Log.d(TAG, String.format("Cannot find preference with key %s in Controller %s",
|
||||
key, controller.getClass().getSimpleName()));
|
||||
return;
|
||||
}
|
||||
controller.updateState(preference);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user