Merge "Add missing settings strings" into tm-dev am: e1bcab3b51
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17944324 Change-Id: I4c4428399fbdf0618b4b77249a9ff40fd20549b1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -862,12 +862,6 @@ public final class DevicePolicyResources {
|
|||||||
public static final String REMOVE_AND_UNINSTALL_DEVICE_ADMIN =
|
public static final String REMOVE_AND_UNINSTALL_DEVICE_ADMIN =
|
||||||
PREFIX + "REMOVE_AND_UNINSTALL_DEVICE_ADMIN";
|
PREFIX + "REMOVE_AND_UNINSTALL_DEVICE_ADMIN";
|
||||||
|
|
||||||
/**
|
|
||||||
* Title for selecting device admin apps
|
|
||||||
*/
|
|
||||||
public static final String SELECT_DEVICE_ADMIN_APPS =
|
|
||||||
PREFIX + "SELECT_DEVICE_ADMIN_APPS";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Message when there are no available device admin apps to display
|
* Message when there are no available device admin apps to display
|
||||||
*/
|
*/
|
||||||
@@ -909,11 +903,6 @@ public final class DevicePolicyResources {
|
|||||||
public static final String ACTIVE_DEVICE_ADMIN_WARNING =
|
public static final String ACTIVE_DEVICE_ADMIN_WARNING =
|
||||||
PREFIX + "ACTIVE_DEVICE_ADMIN_WARNING";
|
PREFIX + "ACTIVE_DEVICE_ADMIN_WARNING";
|
||||||
|
|
||||||
/**
|
|
||||||
* Title for screen to set a profile owner
|
|
||||||
*/
|
|
||||||
public static final String SET_PROFILE_OWNER_TITLE = PREFIX + "SET_PROFILE_OWNER_TITLE";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simplified title for dialog to set a profile owner
|
* Simplified title for dialog to set a profile owner
|
||||||
*/
|
*/
|
||||||
@@ -1173,7 +1162,8 @@ public final class DevicePolicyResources {
|
|||||||
/**
|
/**
|
||||||
* Header for items under the personal user
|
* Header for items under the personal user
|
||||||
*/
|
*/
|
||||||
public static final String PERSONAL_CATEGORY_HEADER = PREFIX + "CATEGORY_PERSONAL";
|
public static final String PERSONAL_CATEGORY_HEADER =
|
||||||
|
PREFIX + "PERSONAL_CATEGORY_HEADER";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Text to indicate work notification content will be shown on the lockscreen.
|
* Text to indicate work notification content will be shown on the lockscreen.
|
||||||
@@ -1196,8 +1186,7 @@ public final class DevicePolicyResources {
|
|||||||
/**
|
/**
|
||||||
* Text for toggle to enable auto-sycing work data
|
* Text for toggle to enable auto-sycing work data
|
||||||
*/
|
*/
|
||||||
public static final String AUTO_SYNC_WORK_DATA = PREFIX
|
public static final String AUTO_SYNC_WORK_DATA = PREFIX + "AUTO_SYNC_WORK_DATA";
|
||||||
+ "AUTO_SYNC_WORK_DATA";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Summary for "More security settings" section when a work profile is on the device.
|
* Summary for "More security settings" section when a work profile is on the device.
|
||||||
@@ -1212,11 +1201,18 @@ public final class DevicePolicyResources {
|
|||||||
public static final String LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE = PREFIX
|
public static final String LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE = PREFIX
|
||||||
+ "LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE";
|
+ "LOCK_SETTINGS_NEW_PROFILE_LOCK_TITLE";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title for screen asking the user to update the type of screen lock (such as a
|
||||||
|
* pattern, PIN, or password) that they need to enter to use their work apps
|
||||||
|
*/
|
||||||
|
public static final String LOCK_SETTINGS_UPDATE_PROFILE_LOCK_TITLE = PREFIX
|
||||||
|
+ "LOCK_SETTINGS_UPDATE_PROFILE_LOCK_TITLE";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Title for section listing information that can be seen by organization
|
* Title for section listing information that can be seen by organization
|
||||||
*/
|
*/
|
||||||
public static final String INFORMATION_SEEN_BY_ORGANIZATION_TITLE = PREFIX
|
public static final String INFORMATION_SEEN_BY_ORGANIZATION_TITLE = PREFIX
|
||||||
+ "information_seen_by_organization_title";
|
+ "INFORMATION_SEEN_BY_ORGANIZATION_TITLE";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Title for section listing changes made by the organization.
|
* Title for section listing changes made by the organization.
|
||||||
@@ -1229,6 +1225,30 @@ public final class DevicePolicyResources {
|
|||||||
*/
|
*/
|
||||||
public static final String ENTERPRISE_PRIVACY_FOOTER =
|
public static final String ENTERPRISE_PRIVACY_FOOTER =
|
||||||
PREFIX + "ENTERPRISE_PRIVACY_FOOTER";
|
PREFIX + "ENTERPRISE_PRIVACY_FOOTER";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title for spell checker settings for work.
|
||||||
|
*/
|
||||||
|
public static final String SPELL_CHECKER_FOR_WORK =
|
||||||
|
PREFIX + "SPELL_CHECKER_FOR_WORK";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Title for personal dictionary for work settings.
|
||||||
|
*/
|
||||||
|
public static final String PERSONAL_DICTIONARY_FOR_WORK =
|
||||||
|
PREFIX + "PERSONAL_DICTIONARY_FOR_WORK";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Summary for switch preference to indicate it is disabled by the admin
|
||||||
|
*/
|
||||||
|
public static final String DISABLED_BY_ADMIN_SWITCH_SUMMARY =
|
||||||
|
PREFIX + "DISABLED_BY_ADMIN_SWITCH_SUMMARY";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Summary for switch preference to indicate it is enabled by the admin
|
||||||
|
*/
|
||||||
|
public static final String ENABLED_BY_ADMIN_SWITCH_SUMMARY =
|
||||||
|
PREFIX + "ENABLED_BY_ADMIN_SWITCH_SUMMARY";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,10 +16,14 @@
|
|||||||
|
|
||||||
package com.android.settingslib;
|
package com.android.settingslib;
|
||||||
|
|
||||||
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.DISABLED_BY_ADMIN_SWITCH_SUMMARY;
|
||||||
|
import static android.app.admin.DevicePolicyResources.Strings.Settings.ENABLED_BY_ADMIN_SWITCH_SUMMARY;
|
||||||
|
|
||||||
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.app.AppOpsManager;
|
import android.app.AppOpsManager;
|
||||||
|
import android.app.admin.DevicePolicyManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
@@ -37,6 +41,8 @@ import androidx.preference.PreferenceManager;
|
|||||||
import androidx.preference.PreferenceViewHolder;
|
import androidx.preference.PreferenceViewHolder;
|
||||||
import androidx.preference.SwitchPreference;
|
import androidx.preference.SwitchPreference;
|
||||||
|
|
||||||
|
import com.android.settingslib.utils.BuildCompatUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version of SwitchPreference that can be disabled by a device admin
|
* Version of SwitchPreference that can be disabled by a device admin
|
||||||
* using a user restriction.
|
* using a user restriction.
|
||||||
@@ -117,8 +123,13 @@ public class RestrictedSwitchPreference extends SwitchPreference {
|
|||||||
|
|
||||||
CharSequence switchSummary;
|
CharSequence switchSummary;
|
||||||
if (mRestrictedSwitchSummary == null) {
|
if (mRestrictedSwitchSummary == null) {
|
||||||
switchSummary = getContext().getText(isChecked()
|
switchSummary = isChecked()
|
||||||
? R.string.enabled_by_admin : R.string.disabled_by_admin);
|
? getUpdatableEnterpriseString(
|
||||||
|
getContext(), ENABLED_BY_ADMIN_SWITCH_SUMMARY,
|
||||||
|
R.string.enabled_by_admin)
|
||||||
|
: getUpdatableEnterpriseString(
|
||||||
|
getContext(), DISABLED_BY_ADMIN_SWITCH_SUMMARY,
|
||||||
|
R.string.disabled_by_admin);
|
||||||
} else {
|
} else {
|
||||||
switchSummary = mRestrictedSwitchSummary;
|
switchSummary = mRestrictedSwitchSummary;
|
||||||
}
|
}
|
||||||
@@ -153,6 +164,16 @@ public class RestrictedSwitchPreference extends SwitchPreference {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getUpdatableEnterpriseString(
|
||||||
|
Context context, String updatableStringId, int resId) {
|
||||||
|
if (!BuildCompatUtils.isAtLeastT()) {
|
||||||
|
return context.getString(resId);
|
||||||
|
}
|
||||||
|
return context.getSystemService(DevicePolicyManager.class).getResources().getString(
|
||||||
|
updatableStringId,
|
||||||
|
() -> context.getString(resId));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void performClick() {
|
public void performClick() {
|
||||||
if (!mHelper.performClick()) {
|
if (!mHelper.performClick()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user