[Catalyst] Migrate AmbientDisplayAlwaysOnPreferenceController

As the preference is exported as external settings, for safety, do not
update the preference key with datastore key. As a workaround, manage a
mapping between preference hierarchy key and datastore key.

Bug: 372307567
Flag: com.android.settings.flags.catalyst_lockscreen_from_display_settings
Test: devtool
Change-Id: I56126485061859b41216cd23b8e1caf63823a1ec
This commit is contained in:
Jacky Wang
2024-11-21 10:21:55 +08:00
parent b6132572ea
commit efcb4dfddf
6 changed files with 136 additions and 6 deletions

View File

@@ -29,6 +29,7 @@ import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settings.core.TogglePreferenceController;
// LINT.IfChange
public class AmbientDisplayAlwaysOnPreferenceController extends TogglePreferenceController {
private final int ON = 1;
@@ -130,3 +131,4 @@ public class AmbientDisplayAlwaysOnPreferenceController extends TogglePreference
return powerManager.isAmbientDisplaySuppressedForTokenByApp(AOD_SUPPRESSED_TOKEN, uid);
}
}
// LINT.ThenChange(AmbientDisplayAlwaysOnPreference.kt)