diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index 63214d5e1e1..0f50d7164f7 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -702,16 +702,16 @@ public class SettingsActivity extends SettingsDrawerActivity || somethingChanged; // Enable/disable the Me Card page. - final boolean isMeCardEnabled = featureFactory + final boolean aboutPhoneV2Enabled = featureFactory .getAccountFeatureProvider() - .isMeCardEnabled(this); + .isAboutPhoneV2Enabled(this); somethingChanged = setTileEnabled(new ComponentName(packageName, Settings.MyDeviceInfoActivity.class.getName()), - isMeCardEnabled, isAdmin) + aboutPhoneV2Enabled, isAdmin) || somethingChanged; somethingChanged = setTileEnabled(new ComponentName(packageName, Settings.DeviceInfoSettingsActivity.class.getName()), - !isMeCardEnabled, isAdmin) + !aboutPhoneV2Enabled, isAdmin) || somethingChanged; if (UserHandle.MU_ENABLED && !isAdmin) { diff --git a/src/com/android/settings/accounts/AccountFeatureProvider.java b/src/com/android/settings/accounts/AccountFeatureProvider.java index bbfc48ac17c..ecde8fed144 100644 --- a/src/com/android/settings/accounts/AccountFeatureProvider.java +++ b/src/com/android/settings/accounts/AccountFeatureProvider.java @@ -28,7 +28,7 @@ public interface AccountFeatureProvider { /** * Checks whether or not to display the new About Phone page. */ - default boolean isMeCardEnabled(Context context) { + default boolean isAboutPhoneV2Enabled(Context context) { return FeatureFlagUtils.isEnabled(context, FeatureFlags.ABOUT_PHONE_V2); } } diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java index 468bd3d31df..51e151ebeff 100644 --- a/src/com/android/settings/core/gateway/SettingsGateway.java +++ b/src/com/android/settings/core/gateway/SettingsGateway.java @@ -28,6 +28,7 @@ import com.android.settings.Settings; import com.android.settings.TestingSettings; import com.android.settings.TetherSettings; import com.android.settings.TrustedCredentialsSettings; +import com.android.settings.deviceinfo.aboutphone.MyDeviceInfoFragment; import com.android.settings.wifi.calling.WifiCallingSettings; import com.android.settings.accessibility.AccessibilitySettings; import com.android.settings.accessibility.AccessibilitySettingsForSetupWizard; @@ -154,6 +155,7 @@ public class SettingsGateway { UserDictionarySettings.class.getName(), DisplaySettings.class.getName(), DeviceInfoSettings.class.getName(), + MyDeviceInfoFragment.class.getName(), ManageApplications.class.getName(), ManageAssist.class.getName(), ProcessStatsUi.class.getName(), diff --git a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java index 05fe326fb15..8a2d5e360e5 100644 --- a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java +++ b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java @@ -62,7 +62,7 @@ import java.util.Arrays; import java.util.List; public class MyDeviceInfoFragment extends DashboardFragment { - private static final String LOG_TAG = "MeCardFragment"; + private static final String LOG_TAG = "MyDeviceInfoFragment"; private static final String KEY_MY_DEVICE_INFO_HEADER = "my_device_info_header"; private static final String KEY_LEGAL_CONTAINER = "legal_container"; diff --git a/tests/uitests/src/com/android/settings/ui/AboutPhoneSettingsTests.java b/tests/uitests/src/com/android/settings/ui/AboutPhoneSettingsTests.java index b92a70773f5..738d7103352 100644 --- a/tests/uitests/src/com/android/settings/ui/AboutPhoneSettingsTests.java +++ b/tests/uitests/src/com/android/settings/ui/AboutPhoneSettingsTests.java @@ -52,10 +52,8 @@ public class AboutPhoneSettingsTests { // TODO: retrieve using name/ids from com.android.settings package private static final String[] sResourceTexts = { "Phone number", - "SIM status", - "Model & hardware", - "MEID", - "Android version" + "Legal information", + "Regulatory labels" }; private UiDevice mDevice; @@ -94,11 +92,11 @@ public class AboutPhoneSettingsTests { } @Test - public void testAllMenuEntriesExist() throws Exception { + public void testAllMenuEntriesExist() { searchForItemsAndTakeAction(mDevice, sResourceTexts); } - private void launchAboutPhoneSettings(String aboutSetting) throws Exception { + private void launchAboutPhoneSettings(String aboutSetting) { Intent aboutIntent = new Intent(aboutSetting); aboutIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); InstrumentationRegistry.getTargetContext().startActivity(aboutIntent); @@ -107,8 +105,7 @@ public class AboutPhoneSettingsTests { /** * Removes items found in the view and optionally takes some action. */ - private void removeItemsAndTakeAction(UiDevice device, ArrayList itemsLeftToFind) - throws Exception { + private void removeItemsAndTakeAction(UiDevice device, ArrayList itemsLeftToFind) { for (Iterator iterator = itemsLeftToFind.iterator(); iterator.hasNext(); ) { String itemText = iterator.next(); UiObject2 item = device.wait(Until.findObject(By.text(itemText)), TIMEOUT); @@ -124,8 +121,7 @@ public class AboutPhoneSettingsTests { *

Will scroll down the screen until it has found all elements or reached the bottom. * This allows elements to be found and acted on even if they change order. */ - private void searchForItemsAndTakeAction(UiDevice device, String[] itemsToFind) - throws Exception { + private void searchForItemsAndTakeAction(UiDevice device, String[] itemsToFind) { ArrayList itemsLeftToFind = new ArrayList<>(Arrays.asList(itemsToFind)); assertWithMessage("There must be at least one item to search for on the screen!")