Replace the existing notifications on lock screen preferences with new page

Replace the existing notifications on lock screen preferences with the new
notifications on lock screen page entries.

Bug: 367455695
Flag: com.android.server.notification.notification_lock_screen_settings
Test: Manual, Settings - Display & touch - Lockscreen; Settings - Security &
privacy - More security & privacy

Change-Id: I858f84db8b5c09895d6b196426b32b3bfbd80d15
This commit is contained in:
Yining Liu
2024-12-03 20:37:38 +00:00
parent 81d390968b
commit 85aa7f7c86
4 changed files with 27 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import com.android.internal.widget.LockPatternUtils;
import com.android.server.notification.Flags;
import com.android.settings.R;
import com.android.settings.RestrictedListPreference;
import com.android.settings.Utils;
@@ -94,6 +95,13 @@ public class LockScreenNotificationPreferenceController extends AbstractPreferen
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
// Hide the preference when the lock screen notification page shows
if (Flags.notificationLockScreenSettings()) {
setVisible(screen, mSettingKey, false);
setVisible(screen, mWorkSettingKey, false);
setVisible(screen, mWorkSettingCategoryKey, false);
return;
}
mLockscreen = screen.findPreference(mSettingKey);
if (mLockscreen == null) {
Log.i(TAG, "Preference not found: " + mSettingKey);