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

Commit 24e673b0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Eliminate useless 'isManagedProfile' utils method"

parents b15f936e 78867164
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ public class ChooseLockGeneric extends SettingsActivity {

            if (DevicePolicyManager.ACTION_SET_NEW_PASSWORD
                    .equals(getActivity().getIntent().getAction())
                    && Utils.isManagedProfile(UserManager.get(getActivity()), mUserId)
                    && UserManager.get(getActivity()).isManagedProfile(mUserId)
                    && mLockPatternUtils.isSeparateProfileChallengeEnabled(mUserId)) {
                getActivity().setTitle(R.string.lock_settings_picker_title_profile);
            }
@@ -198,8 +198,8 @@ public class ChooseLockGeneric extends SettingsActivity {
            } else if (!mWaitingForConfirmation) {
                ChooseLockSettingsHelper helper =
                        new ChooseLockSettingsHelper(this.getActivity(), this);
                boolean managedProfileWithUnifiedLock = Utils
                        .isManagedProfile(UserManager.get(getActivity()), mUserId)
                boolean managedProfileWithUnifiedLock =
                        UserManager.get(getActivity()).isManagedProfile(mUserId)
                        && !mLockPatternUtils.isSeparateProfileChallengeEnabled(mUserId);
                if (managedProfileWithUnifiedLock
                        || !helper.launchConfirmationActivity(CONFIRM_EXISTING_REQUEST,
@@ -733,14 +733,14 @@ public class ChooseLockGeneric extends SettingsActivity {
        }

        private int getResIdForFactoryResetProtectionWarningTitle() {
            boolean isProfile = Utils.isManagedProfile(UserManager.get(getActivity()), mUserId);
            boolean isProfile = UserManager.get(getActivity()).isManagedProfile(mUserId);
            return isProfile ? R.string.unlock_disable_frp_warning_title_profile
                    : R.string.unlock_disable_frp_warning_title;
        }

        private int getResIdForFactoryResetProtectionWarningMessage() {
            boolean hasFingerprints = mFingerprintManager.hasEnrolledFingerprints(mUserId);
            boolean isProfile = Utils.isManagedProfile(UserManager.get(getActivity()), mUserId);
            boolean isProfile = UserManager.get(getActivity()).isManagedProfile(mUserId);
            switch (mLockPatternUtils.getKeyguardStoredPasswordQuality(mUserId)) {
                case DevicePolicyManager.PASSWORD_QUALITY_SOMETHING:
                    if (hasFingerprints && isProfile) {
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ public class ConfirmDeviceCredentialActivity extends Activity {
                Log.e(TAG, "Invalid intent extra", se);
            }
        }
        final boolean isManagedProfile = Utils.isManagedProfile(UserManager.get(this), userId);
        final boolean isManagedProfile = UserManager.get(this).isManagedProfile(userId);
        // if the client app did not hand in a title and we are about to show the work challenge,
        // check whether there is a policy setting the organization name and use that as title
        if ((title == null) && isManagedProfile) {
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ public abstract class ConfirmDeviceCredentialBaseActivity extends SettingsActivi
    protected void onCreate(Bundle savedState) {
        int credentialOwnerUserId = Utils.getCredentialOwnerUserId(this,
                Utils.getUserIdFromBundle(this, getIntent().getExtras()));
        if (Utils.isManagedProfile(UserManager.get(this), credentialOwnerUserId)) {
        if (UserManager.get(this).isManagedProfile(credentialOwnerUserId)) {
            setTheme(R.style.Theme_ConfirmDeviceCredentialsWork);
        } else if (getIntent().getBooleanExtra(
                ConfirmDeviceCredentialBaseFragment.DARK_THEME, false)) {
+2 −2
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
                Utils.getUserIdFromBundle(
                        getActivity(),
                        getActivity().getIntent().getExtras()));
        if (Utils.isManagedProfile(UserManager.get(getActivity()), credentialOwnerUserId)) {
        if (UserManager.get(getActivity()).isManagedProfile(credentialOwnerUserId)) {
            setWorkChallengeBackground(view, credentialOwnerUserId);
        }
    }
@@ -259,7 +259,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
    }

    protected boolean isProfileChallenge() {
        return Utils.isManagedProfile(UserManager.get(getContext()), mEffectiveUserId);
        return UserManager.get(getContext()).isManagedProfile(mEffectiveUserId);
    }

    protected void reportSuccessfullAttempt() {
+1 −2
Original line number Diff line number Diff line
@@ -184,8 +184,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
        }

        private int getDefaultDetails() {
            boolean isProfile = Utils.isManagedProfile(
                    UserManager.get(getActivity()), mEffectiveUserId);
            boolean isProfile = UserManager.get(getActivity()).isManagedProfile(mEffectiveUserId);
            // Map boolean flags to an index by isStrongAuth << 2 + isProfile << 1 + isAlpha.
            int index = ((mIsStrongAuthRequired ? 1 : 0) << 2) + ((isProfile ? 1 : 0) << 1)
                    + (mIsAlpha ? 1 : 0);
Loading