From e14c23fcf9ebd0136faf191cd8fa94b22caa1661 Mon Sep 17 00:00:00 2001 From: Peiyong Lin Date: Tue, 5 Apr 2022 21:45:05 +0000 Subject: [PATCH] Remove GameSettings and ExtraAppInfo. Bug: b/224595815 Test: manual Change-Id: Ifc9a9e8c0b4b2170144639abb2f81f8916d5f164 --- res/values/strings.xml | 5 -- res/xml/apps.xml | 8 -- .../GameSettingsFeatureProvider.java | 34 -------- .../GameSettingsFeatureProviderImpl.java | 35 --------- .../GameSettingsPreferenceController.java | 60 --------------- .../appinfo/AppInfoDashboardFragment.java | 1 - .../appinfo/ExtraAppInfoFeatureProvider.java | 47 ----------- .../ExtraAppInfoFeatureProviderImpl.java | 50 ------------ .../ExtraAppInfoPreferenceController.java | 77 ------------------- .../settings/overlay/FeatureFactory.java | 12 --- .../settings/overlay/FeatureFactoryImpl.java | 22 ------ .../GameSettingsPreferenceControllerTest.java | 65 ---------------- .../ExtraAppInfoFeatureProviderImplTest.java | 54 ------------- .../ExtraAppInfoPreferenceControllerTest.java | 46 ----------- .../testutils/FakeFeatureFactory.java | 16 ---- .../testutils/FakeFeatureFactory.java | 16 ---- 16 files changed, 548 deletions(-) delete mode 100644 src/com/android/settings/applications/GameSettingsFeatureProvider.java delete mode 100644 src/com/android/settings/applications/GameSettingsFeatureProviderImpl.java delete mode 100644 src/com/android/settings/applications/GameSettingsPreferenceController.java delete mode 100644 src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProvider.java delete mode 100644 src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImpl.java delete mode 100644 src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceController.java delete mode 100644 tests/robotests/src/com/android/settings/applications/GameSettingsPreferenceControllerTest.java delete mode 100644 tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImplTest.java delete mode 100644 tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceControllerTest.java diff --git a/res/values/strings.xml b/res/values/strings.xml index 3b59ce40c1a..f568e55ca8c 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -13817,11 +13817,6 @@ For apps and services. If this setting is off, microphone data may still be shared when you call an emergency number. - - Game settings - - Turn on Game Dashboard shortcut, and more - Previous diff --git a/res/xml/apps.xml b/res/xml/apps.xml index e6314dab28a..ea1e6921363 100644 --- a/res/xml/apps.xml +++ b/res/xml/apps.xml @@ -62,14 +62,6 @@ - - - diff --git a/src/com/android/settings/applications/GameSettingsFeatureProvider.java b/src/com/android/settings/applications/GameSettingsFeatureProvider.java deleted file mode 100644 index ac2d6bddbe5..00000000000 --- a/src/com/android/settings/applications/GameSettingsFeatureProvider.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications; - -import android.content.Context; - -/** - * Provider for Game Settings related feature. - */ -public interface GameSettingsFeatureProvider { - /** - * Returns true if the feature is supported. - */ - boolean isSupported(Context context); - - /** - * Launch GameSettings - */ - void launchGameSettings(Context context); -} diff --git a/src/com/android/settings/applications/GameSettingsFeatureProviderImpl.java b/src/com/android/settings/applications/GameSettingsFeatureProviderImpl.java deleted file mode 100644 index 67212e7da8b..00000000000 --- a/src/com/android/settings/applications/GameSettingsFeatureProviderImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications; - -import android.content.Context; - -/** - * Provider implementation for Game Settings related features. - */ -public class GameSettingsFeatureProviderImpl implements - GameSettingsFeatureProvider { - @Override - public boolean isSupported(Context context) { - return false; - } - - @Override - public void launchGameSettings(Context context) { - return; - } -} diff --git a/src/com/android/settings/applications/GameSettingsPreferenceController.java b/src/com/android/settings/applications/GameSettingsPreferenceController.java deleted file mode 100644 index 67c1bb1fea1..00000000000 --- a/src/com/android/settings/applications/GameSettingsPreferenceController.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications; - -import android.content.Context; -import android.text.TextUtils; - -import androidx.preference.Preference; - -import com.android.internal.annotations.VisibleForTesting; -import com.android.settings.core.BasePreferenceController; -import com.android.settings.overlay.FeatureFactory; - -/** Contains logic that deals with showing Game Settings in app settings. */ -public class GameSettingsPreferenceController extends BasePreferenceController { - - @VisibleForTesting - final GameSettingsFeatureProvider mGameSettingsFeatureProvider; - - public GameSettingsPreferenceController(Context context, String key) { - super(context, key); - mGameSettingsFeatureProvider = - FeatureFactory.getFactory(context).getGameSettingsFeatureProvider(); - } - - GameSettingsPreferenceController(Context context, String key, - GameSettingsFeatureProvider gameSettingsFeatureProvider) { - super(context, key); - mGameSettingsFeatureProvider = gameSettingsFeatureProvider; - } - - @Override - public int getAvailabilityStatus() { - return mGameSettingsFeatureProvider.isSupported(mContext) - ? AVAILABLE : UNSUPPORTED_ON_DEVICE; - } - - @Override - public boolean handlePreferenceTreeClick(Preference preference) { - if (TextUtils.equals(getPreferenceKey(), preference.getKey())) { - mGameSettingsFeatureProvider.launchGameSettings(mContext); - return true; - } - return super.handlePreferenceTreeClick(preference); - } -} diff --git a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java index ac5330c4f99..4cf591125a3 100755 --- a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java +++ b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java @@ -178,7 +178,6 @@ public class AppInfoDashboardFragment extends DashboardFragment use(AppStoragePreferenceController.class).setParentFragment(this); use(AppVersionPreferenceController.class).setParentFragment(this); use(InstantAppDomainsPreferenceController.class).setParentFragment(this); - use(ExtraAppInfoPreferenceController.class).setPackageName(packageName); final HibernationSwitchPreferenceController appHibernationSettings = use(HibernationSwitchPreferenceController.class); diff --git a/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProvider.java b/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProvider.java deleted file mode 100644 index ec70f572cdc..00000000000 --- a/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications.appinfo; - -import android.content.Context; - -/** - * Provider for Extra App Info related feature - */ -public interface ExtraAppInfoFeatureProvider { - /** Returns true if the feature is supported. */ - boolean isSupported(Context context); - - /** - * Launch ExtraAppInfoSettings - */ - void launchExtraAppInfoSettings(Context context); - - /** - * Sets the package name - */ - void setPackageName(String packageName); - - /** - * Checks if enabled - */ - boolean isEnabled(Context context); - - /** - * Gets the summary name - */ - String getSummary(Context context); -} diff --git a/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImpl.java b/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImpl.java deleted file mode 100644 index 7d800e68493..00000000000 --- a/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications.appinfo; - -import android.content.Context; - -/** - * Provider for Extra App Info related feature - */ -public class ExtraAppInfoFeatureProviderImpl implements - ExtraAppInfoFeatureProvider { - @Override - public boolean isSupported(Context context) { - return false; - } - - @Override - public void launchExtraAppInfoSettings(Context context) { - return; - } - - @Override - public void setPackageName(String packageName) { - return; - } - - @Override - public boolean isEnabled(Context context) { - return false; - } - - @Override - public String getSummary(Context context) { - return ""; - } -} diff --git a/src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceController.java b/src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceController.java deleted file mode 100644 index 43796d0d85c..00000000000 --- a/src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceController.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications.appinfo; - -import android.content.Context; -import android.text.TextUtils; - -import androidx.preference.Preference; -import androidx.preference.PreferenceScreen; - -import com.android.settings.core.BasePreferenceController; -import com.android.settings.overlay.FeatureFactory; - -/** Contains logic that deals with showing extra app info in app settings. */ -public class ExtraAppInfoPreferenceController extends BasePreferenceController { - - private final ExtraAppInfoFeatureProvider mExtraAppInfoFeatureProvider; - - public ExtraAppInfoPreferenceController(Context context, String key) { - super(context, key); - mExtraAppInfoFeatureProvider = - FeatureFactory.getFactory(context).getExtraAppInfoFeatureProvider(); - } - - @Override - public int getAvailabilityStatus() { - return mExtraAppInfoFeatureProvider.isSupported(mContext) - ? AVAILABLE : UNSUPPORTED_ON_DEVICE; - } - - @Override - public boolean handlePreferenceTreeClick(Preference preference) { - if (TextUtils.equals(getPreferenceKey(), preference.getKey())) { - mExtraAppInfoFeatureProvider.launchExtraAppInfoSettings(mContext); - return true; - } - return super.handlePreferenceTreeClick(preference); - } - - @Override - public CharSequence getSummary() { - return mExtraAppInfoFeatureProvider.getSummary(mContext); - } - - @Override - public void displayPreference(PreferenceScreen screen) { - super.displayPreference(screen); - - if (mExtraAppInfoFeatureProvider != null) { - final Preference preference = screen.findPreference(getPreferenceKey()); - preference.setEnabled(mExtraAppInfoFeatureProvider.isEnabled(preference.getContext())); - } - } - - /** - * Set the local package name - */ - public void setPackageName(String packageName) { - if (mExtraAppInfoFeatureProvider != null) { - mExtraAppInfoFeatureProvider.setPackageName(packageName); - } - } -} diff --git a/src/com/android/settings/overlay/FeatureFactory.java b/src/com/android/settings/overlay/FeatureFactory.java index 93af23193d4..8b78882ce41 100644 --- a/src/com/android/settings/overlay/FeatureFactory.java +++ b/src/com/android/settings/overlay/FeatureFactory.java @@ -27,8 +27,6 @@ import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider; import com.android.settings.accessibility.AccessibilitySearchFeatureProvider; import com.android.settings.accounts.AccountFeatureProvider; import com.android.settings.applications.ApplicationFeatureProvider; -import com.android.settings.applications.GameSettingsFeatureProvider; -import com.android.settings.applications.appinfo.ExtraAppInfoFeatureProvider; import com.android.settings.aware.AwareFeatureProvider; import com.android.settings.biometrics.face.FaceFeatureProvider; import com.android.settings.bluetooth.BluetoothFeatureProvider; @@ -161,21 +159,11 @@ public abstract class FeatureFactory { */ public abstract WifiTrackerLibProvider getWifiTrackerLibProvider(); - /** - * Retrieves implementation for Extra App Info feature. - */ - public abstract ExtraAppInfoFeatureProvider getExtraAppInfoFeatureProvider(); - /** * Retrieves implementation for SecuritySettings feature. */ public abstract SecuritySettingsFeatureProvider getSecuritySettingsFeatureProvider(); - /** - * Retrieves implementation for Game Settings feature. - */ - public abstract GameSettingsFeatureProvider getGameSettingsFeatureProvider(); - /** * Retrieves implementation for Accessibility search index feature. */ diff --git a/src/com/android/settings/overlay/FeatureFactoryImpl.java b/src/com/android/settings/overlay/FeatureFactoryImpl.java index 2c63856d353..4d8dad07e6b 100644 --- a/src/com/android/settings/overlay/FeatureFactoryImpl.java +++ b/src/com/android/settings/overlay/FeatureFactoryImpl.java @@ -33,10 +33,6 @@ import com.android.settings.accounts.AccountFeatureProvider; import com.android.settings.accounts.AccountFeatureProviderImpl; import com.android.settings.applications.ApplicationFeatureProvider; import com.android.settings.applications.ApplicationFeatureProviderImpl; -import com.android.settings.applications.GameSettingsFeatureProvider; -import com.android.settings.applications.GameSettingsFeatureProviderImpl; -import com.android.settings.applications.appinfo.ExtraAppInfoFeatureProvider; -import com.android.settings.applications.appinfo.ExtraAppInfoFeatureProviderImpl; import com.android.settings.aware.AwareFeatureProvider; import com.android.settings.aware.AwareFeatureProviderImpl; import com.android.settings.biometrics.face.FaceFeatureProvider; @@ -107,9 +103,7 @@ public class FeatureFactoryImpl extends FeatureFactory { private AwareFeatureProvider mAwareFeatureProvider; private FaceFeatureProvider mFaceFeatureProvider; private WifiTrackerLibProvider mWifiTrackerLibProvider; - private ExtraAppInfoFeatureProvider mExtraAppInfoFeatureProvider; private SecuritySettingsFeatureProvider mSecuritySettingsFeatureProvider; - private GameSettingsFeatureProvider mGameSettingsFeatureProvider; private AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider; private AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider; @@ -318,14 +312,6 @@ public class FeatureFactoryImpl extends FeatureFactory { return mWifiTrackerLibProvider; } - @Override - public ExtraAppInfoFeatureProvider getExtraAppInfoFeatureProvider() { - if (mExtraAppInfoFeatureProvider == null) { - mExtraAppInfoFeatureProvider = new ExtraAppInfoFeatureProviderImpl(); - } - return mExtraAppInfoFeatureProvider; - } - @Override public SecuritySettingsFeatureProvider getSecuritySettingsFeatureProvider() { if (mSecuritySettingsFeatureProvider == null) { @@ -334,14 +320,6 @@ public class FeatureFactoryImpl extends FeatureFactory { return mSecuritySettingsFeatureProvider; } - @Override - public GameSettingsFeatureProvider getGameSettingsFeatureProvider() { - if (mGameSettingsFeatureProvider == null) { - mGameSettingsFeatureProvider = new GameSettingsFeatureProviderImpl(); - } - return mGameSettingsFeatureProvider; - } - @Override public AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider() { if (mAccessibilitySearchFeatureProvider == null) { diff --git a/tests/robotests/src/com/android/settings/applications/GameSettingsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/GameSettingsPreferenceControllerTest.java deleted file mode 100644 index fa4fce82202..00000000000 --- a/tests/robotests/src/com/android/settings/applications/GameSettingsPreferenceControllerTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications; - -import static com.android.settings.core.BasePreferenceController.AVAILABLE; -import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE; - -import static com.google.common.truth.Truth.assertThat; - -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -import android.content.Context; - -import com.android.settings.testutils.FakeFeatureFactory; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.MockitoAnnotations; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.RuntimeEnvironment; - -@RunWith(RobolectricTestRunner.class) -public class GameSettingsPreferenceControllerTest { - - private GameSettingsPreferenceController mController; - private GameSettingsFeatureProvider mProvider; - private Context mContext; - - @Before - public void setUp() { - MockitoAnnotations.initMocks(this); - mContext = spy(RuntimeEnvironment.application); - - mProvider = FakeFeatureFactory.setupForTest().getGameSettingsFeatureProvider(); - mController = new GameSettingsPreferenceController(mContext, "test_key", mProvider); - } - - @Test - public void getAvailabilityStatus_GameSettingsFeatureEnabled_shouldReturnAVAILABLE() { - when(mProvider.isSupported(mContext)).thenReturn(true); - assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE); - } - - @Test - public void getAvailabilityStatus_GameSettingsFeatureDisabled_shouldReturnUNSUPPORTED_ON_DEVICE() { - when(mProvider.isSupported(mContext)).thenReturn(false); - assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); - } -} diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImplTest.java deleted file mode 100644 index d8ba07351e3..00000000000 --- a/tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoFeatureProviderImplTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications.appinfo; - -import static com.google.common.truth.Truth.assertThat; - -import android.content.Context; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.RuntimeEnvironment; - -@RunWith(RobolectricTestRunner.class) -public class ExtraAppInfoFeatureProviderImplTest { - private Context mContext; - private ExtraAppInfoFeatureProviderImpl mController; - - @Before - public void setUp() { - mContext = RuntimeEnvironment.application; - mController = new ExtraAppInfoFeatureProviderImpl(); - } - - @Test - public void isSupported_notSupportedByDefault() { - assertThat(mController.isSupported(mContext)).isEqualTo(false); - } - - @Test - public void isEnabled_notEnabledByDefault() { - assertThat(mController.isEnabled(mContext)).isEqualTo(false); - } - - @Test - public void getSummary_emptyByDefault() { - assertThat(mController.getSummary(mContext)).isEqualTo(""); - } -} diff --git a/tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceControllerTest.java deleted file mode 100644 index f413908d496..00000000000 --- a/tests/robotests/src/com/android/settings/applications/appinfo/ExtraAppInfoPreferenceControllerTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.applications.appinfo; - -import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE; - -import static com.google.common.truth.Truth.assertThat; - -import android.content.Context; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.robolectric.RobolectricTestRunner; -import org.robolectric.RuntimeEnvironment; - -@RunWith(RobolectricTestRunner.class) -public class ExtraAppInfoPreferenceControllerTest { - private Context mContext; - private ExtraAppInfoPreferenceController mController; - - @Before - public void setUp() { - mContext = RuntimeEnvironment.application; - mController = new ExtraAppInfoPreferenceController(mContext, "test_key"); - } - - @Test - public void getAvailabilityStatus_unavailableByDefault() { - assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE); - } -} diff --git a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java index bc430e832e5..d430232b8f7 100644 --- a/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java +++ b/tests/robotests/src/com/android/settings/testutils/FakeFeatureFactory.java @@ -25,8 +25,6 @@ import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider; import com.android.settings.accessibility.AccessibilitySearchFeatureProvider; import com.android.settings.accounts.AccountFeatureProvider; import com.android.settings.applications.ApplicationFeatureProvider; -import com.android.settings.applications.GameSettingsFeatureProvider; -import com.android.settings.applications.appinfo.ExtraAppInfoFeatureProvider; import com.android.settings.aware.AwareFeatureProvider; import com.android.settings.biometrics.face.FaceFeatureProvider; import com.android.settings.bluetooth.BluetoothFeatureProvider; @@ -86,9 +84,7 @@ public class FakeFeatureFactory extends FeatureFactory { public ContextualCardFeatureProvider mContextualCardFeatureProvider; public WifiTrackerLibProvider wifiTrackerLibProvider; - public ExtraAppInfoFeatureProvider extraAppInfoFeatureProvider; public SecuritySettingsFeatureProvider securitySettingsFeatureProvider; - public GameSettingsFeatureProvider gameSettingsFeatureProvider; public AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider; public AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider; @@ -137,9 +133,7 @@ public class FakeFeatureFactory extends FeatureFactory { mAwareFeatureProvider = mock(AwareFeatureProvider.class); mFaceFeatureProvider = mock(FaceFeatureProvider.class); wifiTrackerLibProvider = mock(WifiTrackerLibProvider.class); - extraAppInfoFeatureProvider = mock(ExtraAppInfoFeatureProvider.class); securitySettingsFeatureProvider = mock(SecuritySettingsFeatureProvider.class); - gameSettingsFeatureProvider = mock(GameSettingsFeatureProvider.class); mAccessibilitySearchFeatureProvider = mock(AccessibilitySearchFeatureProvider.class); mAccessibilityMetricsFeatureProvider = mock(AccessibilityMetricsFeatureProvider.class); } @@ -264,21 +258,11 @@ public class FakeFeatureFactory extends FeatureFactory { return wifiTrackerLibProvider; } - @Override - public ExtraAppInfoFeatureProvider getExtraAppInfoFeatureProvider() { - return extraAppInfoFeatureProvider; - } - @Override public SecuritySettingsFeatureProvider getSecuritySettingsFeatureProvider() { return securitySettingsFeatureProvider; } - @Override - public GameSettingsFeatureProvider getGameSettingsFeatureProvider() { - return gameSettingsFeatureProvider; - } - @Override public AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider() { return mAccessibilitySearchFeatureProvider; diff --git a/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java b/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java index 0b6061c7115..e9764cbbab4 100644 --- a/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java +++ b/tests/unit/src/com/android/settings/testutils/FakeFeatureFactory.java @@ -23,8 +23,6 @@ import com.android.settings.accessibility.AccessibilityMetricsFeatureProvider; import com.android.settings.accessibility.AccessibilitySearchFeatureProvider; import com.android.settings.accounts.AccountFeatureProvider; import com.android.settings.applications.ApplicationFeatureProvider; -import com.android.settings.applications.GameSettingsFeatureProvider; -import com.android.settings.applications.appinfo.ExtraAppInfoFeatureProvider; import com.android.settings.aware.AwareFeatureProvider; import com.android.settings.biometrics.face.FaceFeatureProvider; import com.android.settings.bluetooth.BluetoothFeatureProvider; @@ -81,9 +79,7 @@ public class FakeFeatureFactory extends FeatureFactory { public ContextualCardFeatureProvider mContextualCardFeatureProvider; public WifiTrackerLibProvider wifiTrackerLibProvider; - public ExtraAppInfoFeatureProvider extraAppInfoFeatureProvider; public SecuritySettingsFeatureProvider securitySettingsFeatureProvider; - public GameSettingsFeatureProvider gameSettingsFeatureProvider; public AccessibilitySearchFeatureProvider mAccessibilitySearchFeatureProvider; public AccessibilityMetricsFeatureProvider mAccessibilityMetricsFeatureProvider; @@ -123,9 +119,7 @@ public class FakeFeatureFactory extends FeatureFactory { mAwareFeatureProvider = mock(AwareFeatureProvider.class); mFaceFeatureProvider = mock(FaceFeatureProvider.class); wifiTrackerLibProvider = mock(WifiTrackerLibProvider.class); - extraAppInfoFeatureProvider = mock(ExtraAppInfoFeatureProvider.class); securitySettingsFeatureProvider = mock(SecuritySettingsFeatureProvider.class); - gameSettingsFeatureProvider = mock(GameSettingsFeatureProvider.class); mAccessibilitySearchFeatureProvider = mock(AccessibilitySearchFeatureProvider.class); mAccessibilityMetricsFeatureProvider = mock(AccessibilityMetricsFeatureProvider.class); } @@ -250,21 +244,11 @@ public class FakeFeatureFactory extends FeatureFactory { return wifiTrackerLibProvider; } - @Override - public ExtraAppInfoFeatureProvider getExtraAppInfoFeatureProvider() { - return extraAppInfoFeatureProvider; - } - @Override public SecuritySettingsFeatureProvider getSecuritySettingsFeatureProvider() { return securitySettingsFeatureProvider; } - @Override - public GameSettingsFeatureProvider getGameSettingsFeatureProvider() { - return gameSettingsFeatureProvider; - } - @Override public AccessibilitySearchFeatureProvider getAccessibilitySearchFeatureProvider() { return mAccessibilitySearchFeatureProvider;