Hide ZenMode.getRule() - Settings

Bug: 393321037
Test: atest com.android.settings.notification.modes
Flag: EXEMPT Unflaggable refactoring
Change-Id: Ia9b43146f687ebee29eee0328a92e59c0c6d574a
This commit is contained in:
Matías Hernández
2025-02-18 14:26:49 +01:00
parent 90feafb10a
commit 13bb8e714d
18 changed files with 52 additions and 45 deletions

View File

@@ -16,6 +16,8 @@
package com.android.settings.notification.modes;
import static com.google.common.base.Preconditions.checkNotNull;
import android.content.Context;
import android.service.notification.ZenModeConfig;
@@ -24,6 +26,7 @@ import androidx.preference.Preference;
import androidx.preference.TwoStatePreference;
import com.android.settingslib.notification.modes.ZenMode;
import com.android.settingslib.notification.modes.ZenModeSchedules;
import com.android.settingslib.notification.modes.ZenModesBackend;
/**
@@ -40,7 +43,7 @@ class ZenModeExitAtAlarmPreferenceController extends
@Override
public void updateState(Preference preference, @NonNull ZenMode zenMode) {
mSchedule = ZenModeConfig.tryParseScheduleConditionId(zenMode.getRule().getConditionId());
mSchedule = checkNotNull(ZenModeSchedules.getTimeSchedule(zenMode));
((TwoStatePreference) preference).setChecked(mSchedule.exitAtAlarm);
}