summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2012-10-05 20:53:02 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-05 20:53:03 -0700
commit0b146b238496fdb36ad575f9a0b96dc43f812aa3 (patch)
tree948b5a9b99cec0dfb3bc680bbb2bd8e8026f26dc /src/com/android/settings
parent1f9a07b5e9b1868fc6741c99e74970aa0e9762fe (diff)
parent21c2904ba32b33e5a43d33b9c46abc3ce9d6bbb0 (diff)
downloadpackages_apps_Settings-0b146b238496fdb36ad575f9a0b96dc43f812aa3.zip
packages_apps_Settings-0b146b238496fdb36ad575f9a0b96dc43f812aa3.tar.gz
packages_apps_Settings-0b146b238496fdb36ad575f9a0b96dc43f812aa3.tar.bz2
Merge "Revert "Show warning dialog in a multiuser system when adding a new account."" into jb-mr1-dev
Diffstat (limited to 'src/com/android/settings')
-rw-r--r--src/com/android/settings/accounts/AddAccountSettings.java70
1 files changed, 5 insertions, 65 deletions
diff --git a/src/com/android/settings/accounts/AddAccountSettings.java b/src/com/android/settings/accounts/AddAccountSettings.java
index dffb1ee..e0fe629 100644
--- a/src/com/android/settings/accounts/AddAccountSettings.java
+++ b/src/com/android/settings/accounts/AddAccountSettings.java
@@ -22,25 +22,18 @@ import android.accounts.AccountManagerFuture;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
import android.app.PendingIntent;
-import android.content.DialogInterface;
-import android.content.DialogInterface.OnClickListener;
-import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.android.settings.Utils;
-import com.android.settings.R;
import java.io.IOException;
/**
* Entry point Actiivty for account setup. Works as follows
- * 0) If it is a multi-user system with multiple users, it shows a warning dialog first.
- * If the user accepts this warning, it moves on to step 1.
+ *
* 1) When the other Activities launch this Activity, it launches {@link ChooseAccountActivity}
* without showing anything.
* 2) After receiving an account type from ChooseAccountActivity, this Activity launches the
@@ -65,7 +58,6 @@ public class AddAccountSettings extends Activity {
* application.
*/
private static final String KEY_CALLER_IDENTITY = "pendingIntent";
- private static final String KEY_SHOWED_WARNING = "showedWarning";
private static final String TAG = "AccountSettings";
@@ -76,8 +68,6 @@ public class AddAccountSettings extends Activity {
private static final int CHOOSE_ACCOUNT_REQUEST = 1;
- private static final int DLG_MULTIUSER_WARNING = 1;
-
private PendingIntent mPendingIntent;
private AccountManagerCallback<Bundle> mCallback = new AccountManagerCallback<Bundle>() {
@@ -105,57 +95,21 @@ public class AddAccountSettings extends Activity {
};
private boolean mAddAccountCalled = false;
- private boolean mShowedMultiuserWarning;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState != null) {
- mShowedMultiuserWarning = savedInstanceState.getBoolean(KEY_SHOWED_WARNING);
mAddAccountCalled = savedInstanceState.getBoolean(KEY_ADD_CALLED);
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "restored");
}
- if (!Utils.hasMultipleUsers(this)) {
- mShowedMultiuserWarning = true;
- }
-
- // Show the multiuser warning dialog first. If that was already shown and accepted,
- // then show the account type chooser.
- if (!mShowedMultiuserWarning) {
- showMultiuserWarning();
- } else {
- if (mAddAccountCalled) {
- // We already called add account - maybe the callback was lost.
- finish();
- return;
- }
- showChooseAccount();
+ if (mAddAccountCalled) {
+ // We already called add account - maybe the callback was lost.
+ finish();
+ return;
}
- }
-
- private void showMultiuserWarning() {
- showDialog(DLG_MULTIUSER_WARNING);
- }
-
- public Dialog onCreateDialog(int dlgId) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder.setMessage(R.string.add_account_shared_system_warning);
- builder.setPositiveButton(android.R.string.ok, mDialogClickListener);
- builder.setNegativeButton(android.R.string.cancel, mDialogClickListener);
- builder.setOnDismissListener(new OnDismissListener() {
- public void onDismiss(DialogInterface di) {
- if (!mShowedMultiuserWarning) {
- setResult(RESULT_CANCELED);
- finish();
- }
- }
- });
- return builder.create();
- }
-
- private void showChooseAccount() {
final String[] authorities =
getIntent().getStringArrayExtra(AccountPreferenceBase.AUTHORITIES_FILTER_KEY);
final String[] accountTypes =
@@ -188,7 +142,6 @@ public class AddAccountSettings extends Activity {
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(KEY_ADD_CALLED, mAddAccountCalled);
- outState.putBoolean(KEY_SHOWED_WARNING, mShowedMultiuserWarning);
if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "saved");
}
@@ -207,17 +160,4 @@ public class AddAccountSettings extends Activity {
null /* handler */);
mAddAccountCalled = true;
}
-
- private OnClickListener mDialogClickListener = new OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- if (which == Dialog.BUTTON_POSITIVE) {
- mShowedMultiuserWarning = true;
- showChooseAccount();
- } else if (which == Dialog.BUTTON_NEGATIVE) {
- setResult(RESULT_CANCELED);
- finish();
- }
- }
- };
}