summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/accounts
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2013-04-13 18:30:59 -0700
committerAmith Yamasani <yamasani@google.com>2013-04-13 18:43:41 -0700
commitc39dcc1ce4d1885ef1de926b67e88cf2dd1acaff (patch)
tree0e2fef41f167c65894413400380994be675da2b6 /src/com/android/settings/accounts
parent34a62601adf20482d88c153b13d51074a9f3ae5a (diff)
downloadpackages_apps_Settings-c39dcc1ce4d1885ef1de926b67e88cf2dd1acaff.zip
packages_apps_Settings-c39dcc1ce4d1885ef1de926b67e88cf2dd1acaff.tar.gz
packages_apps_Settings-c39dcc1ce4d1885ef1de926b67e88cf2dd1acaff.tar.bz2
Don't show developer options to secondary users
Show just a message that developer options are not available for the user. Also fix silent exit of AddAccount operation by showing a toast that user cannot add accounts. Bug: 7409523 Bug: 8519646 Bug: 7304007 Change-Id: Id3f430d568d6b7151ac55f86dbc0ef91803fa10c
Diffstat (limited to 'src/com/android/settings/accounts')
-rw-r--r--src/com/android/settings/accounts/AddAccountSettings.java12
-rw-r--r--src/com/android/settings/accounts/ManageAccountsSettings.java1
2 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/settings/accounts/AddAccountSettings.java b/src/com/android/settings/accounts/AddAccountSettings.java
index f1b7752..39906eb 100644
--- a/src/com/android/settings/accounts/AddAccountSettings.java
+++ b/src/com/android/settings/accounts/AddAccountSettings.java
@@ -28,7 +28,9 @@ import android.content.Intent;
import android.os.Bundle;
import android.os.UserManager;
import android.util.Log;
+import android.widget.Toast;
+import com.android.settings.R;
import com.android.settings.Utils;
import java.io.IOException;
@@ -124,9 +126,15 @@ public class AddAccountSettings extends Activity {
}
final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
- if (mAddAccountCalled || um.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS)) {
+ if (um.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS)) {
+ // We aren't allowed to add an account.
+ Toast.makeText(this, R.string.user_cannot_add_accounts_message, Toast.LENGTH_LONG)
+ .show();
+ finish();
+ return;
+ }
+ if (mAddAccountCalled) {
// We already called add account - maybe the callback was lost.
- // Or we aren't allowed to add an account.
finish();
return;
}
diff --git a/src/com/android/settings/accounts/ManageAccountsSettings.java b/src/com/android/settings/accounts/ManageAccountsSettings.java
index 46aa566..8a093ca 100644
--- a/src/com/android/settings/accounts/ManageAccountsSettings.java
+++ b/src/com/android/settings/accounts/ManageAccountsSettings.java
@@ -332,6 +332,7 @@ public class ManageAccountsSettings extends AccountPreferenceBase
getPreferenceScreen().addPreference(preference);
if (mFirstAccount == null) {
mFirstAccount = account;
+ getActivity().invalidateOptionsMenu();
}
}
}