From 84d04c20531c94a52d20098ee675ad55df9acf8f Mon Sep 17 00:00:00 2001 From: Russell Brenner Date: Mon, 1 Oct 2012 17:30:59 -0700 Subject: [PATCH] Pass flag to indicate multiple users on device When creating a new account, some informational text changes when more than one user exists on the device. Because GLS is built with the SDK and because there is no public API to indicate this state, a flag is added to the bundle passed to the AccountManager, which then funnels down to GLS. Bug: 7255673 Change-Id: Ida2aa5f70ab308958de510a95194463c2a089182 --- src/com/android/settings/accounts/AddAccountSettings.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/accounts/AddAccountSettings.java b/src/com/android/settings/accounts/AddAccountSettings.java index c5f2a9b5064..dffb1ee3656 100644 --- a/src/com/android/settings/accounts/AddAccountSettings.java +++ b/src/com/android/settings/accounts/AddAccountSettings.java @@ -55,7 +55,7 @@ import java.io.IOException; */ public class AddAccountSettings extends Activity { /** - * + * */ private static final String KEY_ADD_CALLED = "AddAccountCalled"; @@ -71,6 +71,9 @@ public class AddAccountSettings extends Activity { /* package */ static final String EXTRA_SELECTED_ACCOUNT = "selected_account"; + // show additional info regarding the use of a device with multiple users + static final String EXTRA_HAS_MULTIPLE_USERS = "hasMultipleUsers"; + private static final int CHOOSE_ACCOUNT_REQUEST = 1; private static final int DLG_MULTIUSER_WARNING = 1; @@ -193,6 +196,7 @@ public class AddAccountSettings extends Activity { Bundle addAccountOptions = new Bundle(); mPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(), 0); addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent); + addAccountOptions.putBoolean(EXTRA_HAS_MULTIPLE_USERS, Utils.hasMultipleUsers(this)); AccountManager.get(this).addAccount( accountType, null, /* authTokenType */