diff --git a/res/layout-land/wifi_dpp_qrcode_scanner_fragment.xml b/res/layout-land/wifi_dpp_qrcode_scanner_fragment.xml deleted file mode 100644 index 11bb0ae4eaf..00000000000 --- a/res/layout-land/wifi_dpp_qrcode_scanner_fragment.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/res/layout/wifi_dpp_qrcode_scanner_fragment.xml b/res/layout/wifi_dpp_qrcode_scanner_fragment.xml index dd96d7e93d3..84470ba9a7d 100644 --- a/res/layout/wifi_dpp_qrcode_scanner_fragment.xml +++ b/res/layout/wifi_dpp_qrcode_scanner_fragment.xml @@ -36,19 +36,31 @@ android:gravity="center" android:orientation="vertical"> - - - - + + + + + + + + Charging optimized to protect your battery - To help extend your batter\'s lifespan, charging is optimized + To help extend your battery\'s lifespan, charging is optimized Charging optimized to protect your battery diff --git a/res/xml/flash_notifications_settings.xml b/res/xml/flash_notifications_settings.xml index 63937b1a486..85cc2cb4d15 100644 --- a/res/xml/flash_notifications_settings.xml +++ b/res/xml/flash_notifications_settings.xml @@ -27,7 +27,8 @@ + settings:lottie_rawRes="@drawable/flash_notifications_illustration" + settings:controller="com.android.settings.accessibility.FlashNotificationIllustrationPreferenceController"/> productCharacteristics = new ArraySet<>(characteristicsSplit.length); + Collections.addAll(productCharacteristics, characteristicsSplit); + final boolean isTablet = productCharacteristics.contains("tablet"); + return isTablet ? UNSUPPORTED_ON_DEVICE : AVAILABLE; + } +} diff --git a/src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java b/src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java index a0dac5a9ec5..ae890f87632 100644 --- a/src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java +++ b/src/com/android/settings/activityembedding/ActivityEmbeddingUtils.java @@ -18,6 +18,7 @@ package com.android.settings.activityembedding; import android.app.Activity; import android.content.Context; +import android.os.SystemProperties; import android.util.DisplayMetrics; import android.util.FeatureFlagUtils; import android.util.Log; @@ -39,6 +40,21 @@ public class ActivityEmbeddingUtils { private static final int MIN_SMALLEST_SCREEN_SPLIT_WIDTH_DP = 600; // The minimum width of the activity to show the regular homepage layout. private static final float MIN_REGULAR_HOMEPAGE_LAYOUT_WIDTH_DP = 380f; + + /** + * Indicates whether to enable large screen optimization if the device supports + * the Activity Embedding split feature. + *

+ * Note that the large screen optimization won't be enabled if the device doesn't support the + * Activity Embedding feature regardless of this property value. + * + * @see androidx.window.embedding.SplitController#getSplitSupportStatus + * @see androidx.window.embedding.SplitController.SplitSupportStatus#SPLIT_AVAILABLE + * @see androidx.window.embedding.SplitController.SplitSupportStatus#SPLIT_UNAVAILABLE + */ + private static final boolean SHOULD_ENABLE_LARGE_SCREEN_OPTIMIZATION = + SystemProperties.getBoolean("persist.settings.large_screen_opt.enabled", true); + private static final String TAG = "ActivityEmbeddingUtils"; /** Get the smallest width dp of the window when the split should be used. */ @@ -62,18 +78,35 @@ public class ActivityEmbeddingUtils { return context.getResources().getFloat(R.dimen.config_activity_embed_split_ratio); } - /** Whether to support embedding activity feature. */ + /** + * Returns {@code true} to indicate that Settings app support the Activity Embedding feature on + * this device. Returns {@code false}, otherwise. + */ + public static boolean isSettingsSplitEnabled(Context context) { + return SHOULD_ENABLE_LARGE_SCREEN_OPTIMIZATION + && SplitController.getInstance(context).getSplitSupportStatus() + == SplitController.SplitSupportStatus.SPLIT_AVAILABLE; + } + + /** + * Checks whether to support embedding activity feature with following conditions: + *

    + *
  • Whether {@link #isSettingsSplitEnabled(Context)}
  • + *
  • Whether {@link FeatureFlagUtils#SETTINGS_SUPPORT_LARGE_SCREEN} is enabled
  • + *
  • Whether User setup is completed
  • + *
+ */ public static boolean isEmbeddingActivityEnabled(Context context) { boolean isFlagEnabled = FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_SUPPORT_LARGE_SCREEN); - boolean isSplitSupported = SplitController.getInstance(context).isSplitSupported(); + boolean isSettingsSplitSupported = isSettingsSplitEnabled(context); boolean isUserSetupComplete = WizardManagerHelper.isUserSetupComplete(context); Log.d(TAG, "isFlagEnabled = " + isFlagEnabled); - Log.d(TAG, "isSplitSupported = " + isSplitSupported); + Log.d(TAG, "isSettingsSplitSupported = " + isSettingsSplitSupported); Log.d(TAG, "isUserSetupComplete = " + isUserSetupComplete); - return isFlagEnabled && isSplitSupported && isUserSetupComplete; + return isFlagEnabled && isSettingsSplitSupported && isUserSetupComplete; } /** Whether to show the regular or simplified homepage layout. */ diff --git a/src/com/android/settings/homepage/SettingsHomepageActivity.java b/src/com/android/settings/homepage/SettingsHomepageActivity.java index 7713e270425..03bc1b32fb2 100644 --- a/src/com/android/settings/homepage/SettingsHomepageActivity.java +++ b/src/com/android/settings/homepage/SettingsHomepageActivity.java @@ -58,7 +58,6 @@ import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.window.embedding.ActivityEmbeddingController; -import androidx.window.embedding.SplitController; import androidx.window.embedding.SplitRule; import com.android.settings.R; @@ -429,7 +428,7 @@ public class SettingsHomepageActivity extends FragmentActivity implements private boolean shouldLaunchDeepLinkIntentToRight() { if (!FeatureFlagUtils.isEnabled(this, FeatureFlagUtils.SETTINGS_SUPPORT_LARGE_SCREEN) - || !SplitController.getInstance(this).isSplitSupported()) { + || !ActivityEmbeddingUtils.isSettingsSplitEnabled(this)) { return false; } diff --git a/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java index a396a92ba98..89cc6d90361 100644 --- a/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java +++ b/tests/robotests/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogControllerTest.java @@ -39,7 +39,6 @@ import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -197,11 +196,10 @@ public class ImeiInfoDialogControllerTest { } @Test - @Ignore public void populateImeiInfo_emptyImei_shouldSetMeid_imeiSetToEmptyString() { doReturn(true).when(mController).isCdmaLteEnabled(); when(mTelephonyManager.getPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_CDMA); - when(mTelephonyManager.getImei(anyInt())).thenReturn(null); + when(mTelephonyManager.getImei(anyInt())).thenReturn(""); mController.populateImeiInfo();