summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChiao Cheng <chiaocheng@google.com>2013-04-19 19:20:29 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-19 19:20:29 +0000
commitba268830dd8df812e51fa3045ed1298ad4530608 (patch)
tree9ee87f1a473205e1f1212698d65632b49399b089
parent780f2af0c729ba99ddb1b08cd2435672a15c29a1 (diff)
parent9f0a1c7d7825c4a96278977bc467db46e48fabb7 (diff)
downloadContacts-ba268830dd8df812e51fa3045ed1298ad4530608.tar.gz
Merge "Do not start account setup screen in limited user mode." into jb-mr2-dev
-rw-r--r--src/com/android/contacts/activities/PeopleActivity.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index ebdfe3b39..3fbd89fb0 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -27,6 +27,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
+import android.os.UserManager;
import android.preference.PreferenceActivity;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
@@ -1047,7 +1048,13 @@ public class PeopleActivity extends ContactsActivity
// If there are no accounts on the device and we should show the "no account" prompt
// (based on {@link SharedPreferences}), then launch the account setup activity so the
// user can sign-in or create an account.
- if (!areContactWritableAccountsAvailable() &&
+ //
+ // Also check for ability to modify accounts. In limited user mode, you can't modify
+ // accounts so there is no point sending users to account setup activity.
+ final UserManager userManager = UserManager.get(this);
+ final boolean disallowModifyAccounts = userManager.getUserRestrictions().getBoolean(
+ UserManager.DISALLOW_MODIFY_ACCOUNTS);
+ if (!disallowModifyAccounts && !areContactWritableAccountsAvailable() &&
AccountPromptUtils.shouldShowAccountPrompt(this)) {
AccountPromptUtils.launchAccountPrompt(this);
return;