Loading src/com/android/settings/SettingsActivity.java +4 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading src/com/android/settings/accounts/AccountFeatureProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); } } src/com/android/settings/core/gateway/SettingsGateway.java +2 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(), Loading src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -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"; Loading tests/uitests/src/com/android/settings/ui/AboutPhoneSettingsTests.java +6 −10 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -107,8 +105,7 @@ public class AboutPhoneSettingsTests { /** * Removes items found in the view and optionally takes some action. */ private void removeItemsAndTakeAction(UiDevice device, ArrayList<String> itemsLeftToFind) throws Exception { private void removeItemsAndTakeAction(UiDevice device, ArrayList<String> itemsLeftToFind) { for (Iterator<String> iterator = itemsLeftToFind.iterator(); iterator.hasNext(); ) { String itemText = iterator.next(); UiObject2 item = device.wait(Until.findObject(By.text(itemText)), TIMEOUT); Loading @@ -124,8 +121,7 @@ public class AboutPhoneSettingsTests { * <p>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<String> itemsLeftToFind = new ArrayList<>(Arrays.asList(itemsToFind)); assertWithMessage("There must be at least one item to search for on the screen!") Loading Loading
src/com/android/settings/SettingsActivity.java +4 −4 Original line number Diff line number Diff line Loading @@ -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) { Loading
src/com/android/settings/accounts/AccountFeatureProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -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); } }
src/com/android/settings/core/gateway/SettingsGateway.java +2 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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(), Loading
src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java +1 −1 Original line number Diff line number Diff line Loading @@ -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"; Loading
tests/uitests/src/com/android/settings/ui/AboutPhoneSettingsTests.java +6 −10 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -107,8 +105,7 @@ public class AboutPhoneSettingsTests { /** * Removes items found in the view and optionally takes some action. */ private void removeItemsAndTakeAction(UiDevice device, ArrayList<String> itemsLeftToFind) throws Exception { private void removeItemsAndTakeAction(UiDevice device, ArrayList<String> itemsLeftToFind) { for (Iterator<String> iterator = itemsLeftToFind.iterator(); iterator.hasNext(); ) { String itemText = iterator.next(); UiObject2 item = device.wait(Until.findObject(By.text(itemText)), TIMEOUT); Loading @@ -124,8 +121,7 @@ public class AboutPhoneSettingsTests { * <p>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<String> itemsLeftToFind = new ArrayList<>(Arrays.asList(itemsToFind)); assertWithMessage("There must be at least one item to search for on the screen!") Loading