Merge "Restrict Settings Homepage prior to provisioning" into main

This commit is contained in:
Chris Antol
2024-03-27 00:09:37 +00:00
committed by Android (Google) Code Review
2 changed files with 28 additions and 0 deletions

View File

@@ -187,6 +187,15 @@ public class SettingsHomepageActivity extends FragmentActivity implements
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Ensure device is provisioned in order to access Settings home
// TODO(b/331254029): This should later be replaced in favor of an allowlist
boolean unprovisioned = android.provider.Settings.Global.getInt(getContentResolver(),
android.provider.Settings.Global.DEVICE_PROVISIONED, 0) == 0;
if (unprovisioned) {
Log.e(TAG, "Device is not provisioned, exiting Settings");
finish();
}
mIsEmbeddingActivityEnabled = ActivityEmbeddingUtils.isEmbeddingActivityEnabled(this);
if (mIsEmbeddingActivityEnabled) {
final UserManager um = getSystemService(UserManager.class);