Avoid 2-pane deep link before gone through Setup Wizard

To improve security.

Fix: 238391432
Test: manual
      Flash ROM and check 2-pane bebavior
Change-Id: If96c645319d9df45930644fd438cf479462685b0
This commit is contained in:
Arc Wang
2022-07-08 15:46:40 +08:00
parent b1cb90f7f1
commit be2ea9eb39
3 changed files with 75 additions and 18 deletions

View File

@@ -27,6 +27,8 @@ import androidx.window.embedding.SplitController;
import com.android.settings.R;
import com.google.android.setupcompat.util.WizardManagerHelper;
/** An util class collecting all common methods for the embedding activity features. */
public class ActivityEmbeddingUtils {
// The smallest value of current width of the window when the split should be used.
@@ -65,14 +67,16 @@ public class ActivityEmbeddingUtils {
/** Whether to support embedding activity feature. */
public static boolean isEmbeddingActivityEnabled(Context context) {
final boolean isFlagEnabled = FeatureFlagUtils.isEnabled(context,
boolean isFlagEnabled = FeatureFlagUtils.isEnabled(context,
FeatureFlagUtils.SETTINGS_SUPPORT_LARGE_SCREEN);
final boolean isSplitSupported = SplitController.getInstance().isSplitSupported();
boolean isSplitSupported = SplitController.getInstance().isSplitSupported();
boolean isUserSetupComplete = WizardManagerHelper.isUserSetupComplete(context);
Log.d(TAG, "isFlagEnabled = " + isFlagEnabled);
Log.d(TAG, "isSplitSupported = " + isSplitSupported);
Log.d(TAG, "isUserSetupComplete = " + isUserSetupComplete);
return isFlagEnabled && isSplitSupported;
return isFlagEnabled && isSplitSupported && isUserSetupComplete;
}
/** Whether to show the regular or simplified homepage layout. */