Three kinds of owner info - owner, user and profile

Bug: 8736733

Put the summary "Restricted profile" under the user name in app restrictions panel.
Bug: 8736734

Change-Id: I6b724bd10a9246eb57831bffb737a48c01e0c285
This commit is contained in:
Amith Yamasani
2013-04-28 22:13:22 -07:00
parent c5b036571e
commit b017171587
6 changed files with 27 additions and 7 deletions

View File

@@ -72,11 +72,11 @@
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:paddingBottom="3dip"
android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="13sp"
android:textColor="?android:attr/textColorSecondary"
android:focusable="false"
android:text="@string/user_summary_restricted_profile"
android:maxLines="4" />
</RelativeLayout>
</LinearLayout>

View File

@@ -679,6 +679,10 @@
<string name="show_user_info_on_lockscreen_label">Show user info on lock screen</string>
<!-- Text shown for title of user info setting [CHAR LIMIT=20]-->
<string name="user_info_settings_title">User info</string>
<!-- Text shown next to checkbox for showing profile info on LockScreen [CHAR LIMIT=50]-->
<string name="show_profile_info_on_lockscreen_label">Show profile info on lock screen</string>
<!-- Text shown for title of profile info setting [CHAR LIMIT=20]-->
<string name="profile_info_settings_title">Profile info</string>
<!-- Main Settings screen setting option title for the item to take you to the location screen -->
<string name="location_settings_title">Location access</string>
<!-- Main Settings screen setting option title for the item to take you to the security screen -->

View File

@@ -81,7 +81,11 @@ public class OwnerInfoSettings extends Fragment {
}
mCheckbox.setChecked(enabled);
if (UserHandle.myUserId() != UserHandle.USER_OWNER) {
mCheckbox.setText(R.string.show_user_info_on_lockscreen_label);
if (UserManager.get(getActivity()).isLinkedUser()) {
mCheckbox.setText(R.string.show_profile_info_on_lockscreen_label);
} else {
mCheckbox.setText(R.string.show_user_info_on_lockscreen_label);
}
}
mCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

View File

@@ -168,7 +168,11 @@ public class SecuritySettings extends SettingsPreferenceFragment
// Rename owner info settings
Preference ownerInfoPref = findPreference(KEY_OWNER_INFO_SETTINGS);
if (ownerInfoPref != null) {
ownerInfoPref.setTitle(R.string.user_info_settings_title);
if (UserManager.get(getActivity()).isLinkedUser()) {
ownerInfoPref.setTitle(R.string.profile_info_settings_title);
} else {
ownerInfoPref.setTitle(R.string.user_info_settings_title);
}
}
}

View File

@@ -763,7 +763,11 @@ public class Settings extends PreferenceActivity
titleRes = R.string.wallpaper_settings_fragment_title;
} else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
&& UserHandle.myUserId() != UserHandle.USER_OWNER) {
titleRes = R.string.user_info_settings_title;
if (UserManager.get(this).isLinkedUser()) {
titleRes = R.string.profile_info_settings_title;
} else {
titleRes = R.string.user_info_settings_title;
}
}
startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
null, 0);

View File

@@ -350,11 +350,15 @@ public class UserSettings extends SettingsPreferenceFragment
} else if (info.id == UserHandle.myUserId()) {
// Jump to owner info panel
Bundle extras = new Bundle();
extras.putBoolean(OwnerInfoSettings.EXTRA_SHOW_NICKNAME, true);
if (!info.isRestricted()) {
extras.putBoolean(OwnerInfoSettings.EXTRA_SHOW_NICKNAME, true);
}
int titleResId = info.id == UserHandle.USER_OWNER ? R.string.owner_info_settings_title
: (info.isRestricted() ? R.string.profile_info_settings_title
: R.string.user_info_settings_title);
((PreferenceActivity) getActivity()).startPreferencePanel(
OwnerInfoSettings.class.getName(),
extras, R.string.user_info_settings_title, null,
null, 0);
extras, titleResId, null, null, 0);
}
}