Misc fixes for account/users fragments

- Hide add user button when it's not functional
- Display "No accounts added" under accounts setting when there is no account.

Change-Id: Iefede9939d206eb3064fa22bdcfbcb1e826f29ab
Fixes: 72643060
Test: robotest
Test: 72713118
This commit is contained in:
Fan Zhang
2018-01-30 17:04:46 -08:00
parent 07c2cdee1f
commit dc2a3528d5
4 changed files with 55 additions and 12 deletions

View File

@@ -249,11 +249,14 @@ public class UserSettings extends SettingsPreferenceFragment
mAddUser.useAdminDisabledSummary(false);
// Determine if add user/profile button should be visible
if (mUserCaps.mCanAddUser && Utils.isDeviceProvisioned(getActivity())) {
mAddUser.setVisible(true);
mAddUser.setOnPreferenceClickListener(this);
// change label to only mention user, if restricted profiles are not supported
if (!mUserCaps.mCanAddRestrictedProfile) {
mAddUser.setTitle(R.string.user_add_user_menu);
}
} else {
mAddUser.setVisible(false);
}
final IntentFilter filter = new IntentFilter(Intent.ACTION_USER_REMOVED);
filter.addAction(Intent.ACTION_USER_INFO_CHANGED);