[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

@@ -23,6 +23,7 @@ import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import android.content.Context;
@@ -88,7 +89,11 @@ public class LockscreenDashboardFragmentTest {
AmbientDisplayAlwaysOnPreferenceController.class);
mTestFragment.onAttach(mContext);
verify(controller).setConfig(any());
if (mTestFragment.isCatalystEnabled()) {
verifyNoInteractions(controller);
} else {
verify(controller).setConfig(any());
}
}
@Test