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:
@@ -72,11 +72,11 @@
|
|||||||
android:layout_below="@android:id/title"
|
android:layout_below="@android:id/title"
|
||||||
android:layout_alignStart="@android:id/title"
|
android:layout_alignStart="@android:id/title"
|
||||||
android:paddingBottom="3dip"
|
android:paddingBottom="3dip"
|
||||||
android:visibility="gone"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
|
android:text="@string/user_summary_restricted_profile"
|
||||||
android:maxLines="4" />
|
android:maxLines="4" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -679,6 +679,10 @@
|
|||||||
<string name="show_user_info_on_lockscreen_label">Show user info on lock screen</string>
|
<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]-->
|
<!-- Text shown for title of user info setting [CHAR LIMIT=20]-->
|
||||||
<string name="user_info_settings_title">User info</string>
|
<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 -->
|
<!-- Main Settings screen setting option title for the item to take you to the location screen -->
|
||||||
<string name="location_settings_title">Location access</string>
|
<string name="location_settings_title">Location access</string>
|
||||||
<!-- Main Settings screen setting option title for the item to take you to the security screen -->
|
<!-- Main Settings screen setting option title for the item to take you to the security screen -->
|
||||||
|
@@ -81,7 +81,11 @@ public class OwnerInfoSettings extends Fragment {
|
|||||||
}
|
}
|
||||||
mCheckbox.setChecked(enabled);
|
mCheckbox.setChecked(enabled);
|
||||||
if (UserHandle.myUserId() != UserHandle.USER_OWNER) {
|
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() {
|
mCheckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
@@ -168,7 +168,11 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
// Rename owner info settings
|
// Rename owner info settings
|
||||||
Preference ownerInfoPref = findPreference(KEY_OWNER_INFO_SETTINGS);
|
Preference ownerInfoPref = findPreference(KEY_OWNER_INFO_SETTINGS);
|
||||||
if (ownerInfoPref != null) {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -763,7 +763,11 @@ public class Settings extends PreferenceActivity
|
|||||||
titleRes = R.string.wallpaper_settings_fragment_title;
|
titleRes = R.string.wallpaper_settings_fragment_title;
|
||||||
} else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
|
} else if (pref.getFragment().equals(OwnerInfoSettings.class.getName())
|
||||||
&& UserHandle.myUserId() != UserHandle.USER_OWNER) {
|
&& 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(),
|
startPreferencePanel(pref.getFragment(), pref.getExtras(), titleRes, pref.getTitle(),
|
||||||
null, 0);
|
null, 0);
|
||||||
|
@@ -350,11 +350,15 @@ public class UserSettings extends SettingsPreferenceFragment
|
|||||||
} else if (info.id == UserHandle.myUserId()) {
|
} else if (info.id == UserHandle.myUserId()) {
|
||||||
// Jump to owner info panel
|
// Jump to owner info panel
|
||||||
Bundle extras = new Bundle();
|
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(
|
((PreferenceActivity) getActivity()).startPreferencePanel(
|
||||||
OwnerInfoSettings.class.getName(),
|
OwnerInfoSettings.class.getName(),
|
||||||
extras, R.string.user_info_settings_title, null,
|
extras, titleResId, null, null, 0);
|
||||||
null, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user