Merge "Only ask for credentials in add account if user is locked." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
832c8e4fda
@@ -35,14 +35,10 @@ import android.widget.Toast;
|
|||||||
import com.android.settings.ChooseLockSettingsHelper;
|
import com.android.settings.ChooseLockSettingsHelper;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
import com.android.settingslib.RestrictedLockUtils;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static android.content.Intent.EXTRA_USER;
|
import static android.content.Intent.EXTRA_USER;
|
||||||
|
|
||||||
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point Activity for account setup. Works as follows
|
* Entry point Activity for account setup. Works as follows
|
||||||
*
|
*
|
||||||
@@ -156,8 +152,15 @@ public class AddAccountSettings extends Activity {
|
|||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (Utils.startQuietModeDialogIfNecessary(this, um, mUserHandle.getIdentifier())) {
|
||||||
// If the profile is locked, we must ask the user to unlock it first.
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (um.isUserUnlocked(mUserHandle)) {
|
||||||
|
requestChooseAccount();
|
||||||
|
} else {
|
||||||
|
// If the user is locked by fbe: we couldn't start the authenticator. So we must ask the
|
||||||
|
// user to unlock it first.
|
||||||
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
|
ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
|
||||||
if (!helper.launchConfirmationActivity(UNLOCK_WORK_PROFILE_REQUEST,
|
if (!helper.launchConfirmationActivity(UNLOCK_WORK_PROFILE_REQUEST,
|
||||||
getString(R.string.unlock_set_unlock_launch_picker_title),
|
getString(R.string.unlock_set_unlock_launch_picker_title),
|
||||||
@@ -166,6 +169,7 @@ public class AddAccountSettings extends Activity {
|
|||||||
requestChooseAccount();
|
requestChooseAccount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
Reference in New Issue
Block a user