Add missing settings strings.
Also re-enable and fix tests. Test: manual Fixes: 226183482 Fixes: 218799125 Fixes: 219375624 Change-Id: I9605f1f4e2e834baf63e015e96639567c5481b5f
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.settings.applications.autofill;
|
||||
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.AUTO_SYNC_PERSONAL_DATA;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.AUTO_SYNC_WORK_DATA;
|
||||
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||
import static android.service.autofill.AutofillService.EXTRA_RESULT;
|
||||
|
||||
@@ -114,6 +116,11 @@ public class PasswordsPreferenceController extends BasePreferenceController
|
||||
super.displayPreference(screen);
|
||||
final PreferenceGroup group = screen.findPreference(getPreferenceKey());
|
||||
addPasswordPreferences(screen.getContext(), getUser(), group);
|
||||
|
||||
replaceEnterpriseStringTitle(screen, "auto_sync_personal_account_data",
|
||||
AUTO_SYNC_PERSONAL_DATA, R.string.account_settings_menu_auto_sync_personal);
|
||||
replaceEnterpriseStringTitle(screen, "auto_sync_work_account_data",
|
||||
AUTO_SYNC_WORK_DATA, R.string.account_settings_menu_auto_sync_work);
|
||||
}
|
||||
|
||||
private void addPasswordPreferences(
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.settings.applications.specialaccess.deviceadmin;
|
||||
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.MANAGE_DEVICE_ADMIN_APPS;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.NO_DEVICE_ADMINS;
|
||||
|
||||
import android.app.settings.SettingsEnums;
|
||||
@@ -37,7 +38,8 @@ public class DeviceAdminSettings extends DashboardFragment {
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
// TODO: Replace PreferenceScreen title manage_device_admin/MANAGE_DEVICE_ADMIN_APPS
|
||||
replaceEnterprisePreferenceScreenTitle(
|
||||
MANAGE_DEVICE_ADMIN_APPS, R.string.manage_device_admin);
|
||||
replaceEnterpriseStringTitle("device_admin_footer",
|
||||
NO_DEVICE_ADMINS, R.string.no_device_admins);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.settings.applications.specialaccess.interactacrossprofiles;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.APP_CAN_ACCESS_PERSONAL_DATA;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.APP_CAN_ACCESS_PERSONAL_PERMISSIONS;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONNECTED_APPS_SHARE_PERMISSIONS_AND_DATA;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONNECTED_WORK_AND_PERSONAL_APPS_TITLE;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONNECT_APPS_DIALOG_SUMMARY;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONNECT_APPS_DIALOG_TITLE;
|
||||
import static android.app.admin.DevicePolicyResources.Strings.Settings.HOW_TO_DISCONNECT_APPS;
|
||||
@@ -81,7 +82,6 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
|
||||
private Context mContext;
|
||||
private CrossProfileApps mCrossProfileApps;
|
||||
private DevicePolicyManager mDevicePolicyManager;
|
||||
private UserManager mUserManager;
|
||||
private RestrictedSwitchPreference mSwitchPref;
|
||||
private LayoutPreference mHeader;
|
||||
@@ -101,7 +101,6 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
|
||||
mContext = getContext();
|
||||
mCrossProfileApps = mContext.getSystemService(CrossProfileApps.class);
|
||||
mDevicePolicyManager = mContext.getSystemService(DevicePolicyManager.class);
|
||||
mUserManager = mContext.getSystemService(UserManager.class);
|
||||
mPackageManager = mContext.getPackageManager();
|
||||
|
||||
@@ -115,6 +114,8 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
|
||||
addPreferencesFromResource(R.xml.interact_across_profiles_permissions_details);
|
||||
|
||||
replaceEnterprisePreferenceScreenTitle(CONNECTED_WORK_AND_PERSONAL_APPS_TITLE,
|
||||
R.string.interact_across_profiles_title);
|
||||
replaceEnterpriseStringSummary("interact_across_profiles_summary_1",
|
||||
CONNECTED_APPS_SHARE_PERMISSIONS_AND_DATA,
|
||||
R.string.interact_across_profiles_summary_1);
|
||||
@@ -147,19 +148,6 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
||||
logPageLaunchMetrics();
|
||||
}
|
||||
|
||||
private void replaceEnterpriseStringSummary(
|
||||
String preferenceKey, String overrideKey, int resource) {
|
||||
Preference preference = findPreference(preferenceKey);
|
||||
if (preference == null) {
|
||||
Log.d(TAG, "Could not find enterprise preference " + preferenceKey);
|
||||
return;
|
||||
}
|
||||
|
||||
preference.setSummary(
|
||||
mDevicePolicyManager.getResources().getString(overrideKey,
|
||||
() -> getString(resource)));
|
||||
}
|
||||
|
||||
private void maybeShowExtraSummary() {
|
||||
Preference extraSummary = findPreference(INTERACT_ACROSS_PROFILE_EXTRA_SUMMARY_KEY);
|
||||
if (extraSummary == null) {
|
||||
|
||||
@@ -53,7 +53,6 @@ public class InteractAcrossProfilesSettings extends EmptyTextSettings {
|
||||
private Context mContext;
|
||||
private PackageManager mPackageManager;
|
||||
private UserManager mUserManager;
|
||||
private DevicePolicyManager mDevicePolicyManager;
|
||||
private CrossProfileApps mCrossProfileApps;
|
||||
private IconDrawableFactory mIconDrawableFactory;
|
||||
|
||||
@@ -66,7 +65,6 @@ public class InteractAcrossProfilesSettings extends EmptyTextSettings {
|
||||
mUserManager = mContext.getSystemService(UserManager.class);
|
||||
mIconDrawableFactory = IconDrawableFactory.newInstance(mContext);
|
||||
mCrossProfileApps = mContext.getSystemService(CrossProfileApps.class);
|
||||
mDevicePolicyManager = mContext.getSystemService(DevicePolicyManager.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -76,6 +74,9 @@ public class InteractAcrossProfilesSettings extends EmptyTextSettings {
|
||||
final PreferenceScreen screen = getPreferenceScreen();
|
||||
screen.removeAll();
|
||||
|
||||
replaceEnterprisePreferenceScreenTitle(CONNECTED_WORK_AND_PERSONAL_APPS_TITLE,
|
||||
R.string.interact_across_profiles_title);
|
||||
|
||||
final ArrayList<Pair<ApplicationInfo, UserHandle>> crossProfileApps =
|
||||
collectConfigurableApps(mPackageManager, mUserManager, mCrossProfileApps);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user