Clean up AwareFeatureProvider from Settings

Bug: 287566056
Test: m Settings
Change-Id: I7f7f57809c55bf8824b427f0d4a232cacdbe88a7
This commit is contained in:
Chaohui Wang
2023-06-19 22:58:18 +08:00
parent 5464140360
commit 2e4141e4ab
15 changed files with 5 additions and 259 deletions

View File

@@ -18,17 +18,11 @@ package com.android.settings.system;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.Context;
import android.os.Bundle;
import com.android.settings.aware.AwareFeatureProvider;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.XmlTestUtils;
import com.android.settings.testutils.shadow.SettingsShadowResources;
import com.android.settings.testutils.shadow.ShadowUserManager;
@@ -75,27 +69,4 @@ public class SystemDashboardFragmentTest {
assertThat(keys).containsAtLeastElementsIn(niks);
}
@Test
public void showRestrictionDialog_hasValidExtra_shouldShowDialog() {
final AwareFeatureProvider mProvider =
FakeFeatureFactory.setupForTest().mAwareFeatureProvider;
final Bundle bundle = new Bundle();
bundle.putBoolean(SystemDashboardFragment.EXTRA_SHOW_AWARE_DISABLED, true);
when(mFragment.getArguments()).thenReturn(bundle);
mFragment.showRestrictionDialog();
verify(mProvider).showRestrictionDialog(any());
}
@Test
public void showRestrictionDialog_hasInvalidExtra_shouldNotShowDialog() {
final AwareFeatureProvider mProvider =
FakeFeatureFactory.setupForTest().mAwareFeatureProvider;
mFragment.showRestrictionDialog();
verify(mProvider, never()).showRestrictionDialog(any());
}
}