Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44b02abb authored by Prabal Singh's avatar Prabal Singh Committed by Android (Google) Code Review
Browse files

Merge "Redirect AdvancedSecuritySettings to MoreSettings"

parents 402f1d0f a644a64f
Loading
Loading
Loading
Loading
+27 −1
Original line number Diff line number Diff line
@@ -208,7 +208,33 @@ public class Settings extends SettingsActivity {
        }
    }
    /** Activity for the Advanced security settings. */
    public static class SecurityAdvancedSettings extends SettingsActivity { /* empty */ }
    public static class SecurityAdvancedSettings extends SettingsActivity {
        private static final String TAG = "SecurityAdvancedActivity";
        @Override
        protected void onCreate(Bundle savedState) {
            super.onCreate(savedState);
            handleMoreSettingsRedirection();
        }

        /** Redirects to More Settings if Safety center is enabled. */
        @VisibleForTesting
        public void handleMoreSettingsRedirection() {
            if (isFinishing()) {
                // Don't trampoline if already exiting this activity.
                return;
            }

            if (SafetyCenterManagerWrapper.get().isEnabled(this)) {
                try {
                    startActivity(
                            new Intent("com.android.settings.MORE_SECURITY_PRIVACY_SETTINGS"));
                    finish();
                } catch (ActivityNotFoundException e) {
                    Log.e(TAG, "Unable to open More Settings", e);
                }
            }
        }
    }
    /** Activity for the More settings page. */
    public static class MoreSecurityPrivacySettingsActivity extends SettingsActivity { /* empty */ }
    public static class UsageAccessSettingsActivity extends SettingsActivity { /* empty */ }