Fix PlatformCompatDashboardTest.

CompatibilityChangeInfo constructor has a new parameter.
The logging only is not currently reflected in the dashboard - it will be grayed out as it's not overridable.
In a followup we can group those changes together in the UI.

Test: atest com.android.settings.development.compat.PlatformCompatDashboardTest
bug: 148009004
Change-Id: I833669f7f2a5128bdeda7451b8ff6e0bb753c500
Merged-In: I833669f7f2a5128bdeda7451b8ff6e0bb753c500
This commit is contained in:
atrost
2020-03-02 20:02:43 +00:00
committed by Anna Trostanetski
parent 06cafcd733
commit 62c470475f

View File

@@ -88,11 +88,11 @@ public class PlatformCompatDashboardTest {
public void setUp() throws RemoteException, NameNotFoundException { public void setUp() throws RemoteException, NameNotFoundException {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
mChanges = new CompatibilityChangeInfo[5]; mChanges = new CompatibilityChangeInfo[5];
mChanges[0] = new CompatibilityChangeInfo(1L, "Default_Enabled", 0, false, ""); mChanges[0] = new CompatibilityChangeInfo(1L, "Default_Enabled", 0, false, false, "");
mChanges[1] = new CompatibilityChangeInfo(2L, "Default_Disabled", 0, true, ""); mChanges[1] = new CompatibilityChangeInfo(2L, "Default_Disabled", 0, true, false, "");
mChanges[2] = new CompatibilityChangeInfo(3L, "Enabled_After_SDK_1_1", 1, false, ""); mChanges[2] = new CompatibilityChangeInfo(3L, "Enabled_After_SDK_1_1", 1, false, false, "");
mChanges[3] = new CompatibilityChangeInfo(4L, "Enabled_After_SDK_1_2", 1, false, ""); mChanges[3] = new CompatibilityChangeInfo(4L, "Enabled_After_SDK_1_2", 1, false, false, "");
mChanges[4] = new CompatibilityChangeInfo(5L, "Enabled_After_SDK_2", 2, false, ""); mChanges[4] = new CompatibilityChangeInfo(5L, "Enabled_After_SDK_2", 2, false, false, "");
when(mPlatformCompat.listAllChanges()).thenReturn(mChanges); when(mPlatformCompat.listAllChanges()).thenReturn(mChanges);
when(mPlatformCompat.getOverrideValidator()).thenReturn(mOverrideValidator); when(mPlatformCompat.getOverrideValidator()).thenReturn(mOverrideValidator);
// By default, allow any change // By default, allow any change
@@ -205,7 +205,7 @@ public class PlatformCompatDashboardTest {
for (int i = 0; i < mChanges.length; ++i) { for (int i = 0; i < mChanges.length; ++i) {
changesToAdd.add(new CompatibilityChangeInfo(mChanges[i].getId(), mChanges[i].getName(), changesToAdd.add(new CompatibilityChangeInfo(mChanges[i].getId(), mChanges[i].getName(),
mChanges[i].getEnableAfterTargetSdk(), mChanges[i].getDisabled(), mChanges[i].getEnableAfterTargetSdk(), mChanges[i].getDisabled(),
mChanges[i].getDescription())); mChanges[i].getLoggingOnly(), mChanges[i].getDescription()));
} }
PreferenceCategory category = mDashboard.createChangeCategoryPreference(changesToAdd, PreferenceCategory category = mDashboard.createChangeCategoryPreference(changesToAdd,