Merge "Add extra summary string in cross profiles page" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
debe9b3577
@@ -8706,6 +8706,11 @@
|
|||||||
to the user's IT admin. [CHAR LIMIT=NONE] -->
|
to the user's IT admin. [CHAR LIMIT=NONE] -->
|
||||||
<string name="interact_across_profiles_summary_2">Only connect apps if you trust them not to share personal data with your IT admin.</string>
|
<string name="interact_across_profiles_summary_2">Only connect apps if you trust them not to share personal data with your IT admin.</string>
|
||||||
|
|
||||||
|
<!-- Settings text. This text lets a user know that they can disconnect work and personal apps from
|
||||||
|
the Privacy page in settings, This is only shown when the connected app page is launched via
|
||||||
|
an app, not when navigated to via settings. [CHAR LIMIT=NONE] -->
|
||||||
|
<string name="interact_across_profiles_summary_3">You can disconnect apps anytime in your device\u2019s privacy settings.</string>
|
||||||
|
|
||||||
<!-- Dialog title. This dialog is shown when a user tries to connect a work app to a personal
|
<!-- Dialog title. This dialog is shown when a user tries to connect a work app to a personal
|
||||||
app (e.g. their work Calendar to their personal Calendar), and it's confirming that they should
|
app (e.g. their work Calendar to their personal Calendar), and it's confirming that they should
|
||||||
connect the apps only if they trust the work app with their personal data. [CHAR LIMIT=NONE] -->
|
connect the apps only if they trust the work app with their personal data. [CHAR LIMIT=NONE] -->
|
||||||
|
@@ -38,4 +38,9 @@
|
|||||||
<Preference
|
<Preference
|
||||||
android:summary="@string/interact_across_profiles_summary_2"
|
android:summary="@string/interact_across_profiles_summary_2"
|
||||||
android:selectable="false" />
|
android:selectable="false" />
|
||||||
|
|
||||||
|
<Preference
|
||||||
|
android:key="interact_across_profiles_extra_summary"
|
||||||
|
android:summary="@string/interact_across_profiles_summary_3"
|
||||||
|
android:selectable="false"/>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -63,6 +63,8 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
"interact_across_profiles_settings_switch";
|
"interact_across_profiles_settings_switch";
|
||||||
private static final String INTERACT_ACROSS_PROFILES_HEADER = "interact_across_profiles_header";
|
private static final String INTERACT_ACROSS_PROFILES_HEADER = "interact_across_profiles_header";
|
||||||
public static final String INSTALL_APP_BANNER_KEY = "install_app_banner";
|
public static final String INSTALL_APP_BANNER_KEY = "install_app_banner";
|
||||||
|
public static final String INTERACT_ACROSS_PROFILE_EXTRA_SUMMARY_KEY =
|
||||||
|
"interact_across_profiles_extra_summary";
|
||||||
public static final String EXTRA_SHOW_FRAGMENT_ARGS = ":settings:show_fragment_args";
|
public static final String EXTRA_SHOW_FRAGMENT_ARGS = ":settings:show_fragment_args";
|
||||||
public static final String INTENT_KEY = "intent";
|
public static final String INTENT_KEY = "intent";
|
||||||
|
|
||||||
@@ -79,6 +81,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
private boolean mInstalledInWork;
|
private boolean mInstalledInWork;
|
||||||
private String mAppLabel;
|
private String mAppLabel;
|
||||||
private Intent mInstallAppIntent;
|
private Intent mInstallAppIntent;
|
||||||
|
private boolean mIsPageLaunchedByApp;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -106,6 +109,8 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
mInstallBanner = findPreference(INSTALL_APP_BANNER_KEY);
|
mInstallBanner = findPreference(INSTALL_APP_BANNER_KEY);
|
||||||
mInstallBanner.setOnPreferenceClickListener(this);
|
mInstallBanner.setOnPreferenceClickListener(this);
|
||||||
|
|
||||||
|
mIsPageLaunchedByApp = launchedByApp();
|
||||||
|
|
||||||
// refreshUi checks that the user can still configure the appOp, return to the
|
// refreshUi checks that the user can still configure the appOp, return to the
|
||||||
// previous page if it can't.
|
// previous page if it can't.
|
||||||
if (!refreshUi()) {
|
if (!refreshUi()) {
|
||||||
@@ -113,14 +118,23 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
}
|
}
|
||||||
addAppTitleAndIcons(mPersonalProfile, mWorkProfile);
|
addAppTitleAndIcons(mPersonalProfile, mWorkProfile);
|
||||||
styleActionBar();
|
styleActionBar();
|
||||||
|
maybeShowExtraSummary();
|
||||||
logPageLaunchMetrics();
|
logPageLaunchMetrics();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void maybeShowExtraSummary() {
|
||||||
|
Preference extraSummary = findPreference(INTERACT_ACROSS_PROFILE_EXTRA_SUMMARY_KEY);
|
||||||
|
if (extraSummary == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
extraSummary.setVisible(mIsPageLaunchedByApp);
|
||||||
|
}
|
||||||
|
|
||||||
private void logPageLaunchMetrics() {
|
private void logPageLaunchMetrics() {
|
||||||
if (!mCrossProfileApps.canConfigureInteractAcrossProfiles(mPackageName)) {
|
if (!mCrossProfileApps.canConfigureInteractAcrossProfiles(mPackageName)) {
|
||||||
logNonConfigurableAppMetrics();
|
logNonConfigurableAppMetrics();
|
||||||
}
|
}
|
||||||
if (launchedByApp()) {
|
if (mIsPageLaunchedByApp) {
|
||||||
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_LAUNCHED_FROM_APP);
|
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_LAUNCHED_FROM_APP);
|
||||||
} else {
|
} else {
|
||||||
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_LAUNCHED_FROM_SETTINGS);
|
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_LAUNCHED_FROM_SETTINGS);
|
||||||
@@ -262,7 +276,7 @@ public class InteractAcrossProfilesDetails extends AppInfoBase
|
|||||||
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_USER_CONSENTED);
|
logEvent(DevicePolicyEnums.CROSS_PROFILE_SETTINGS_PAGE_USER_CONSENTED);
|
||||||
enableInteractAcrossProfiles(true);
|
enableInteractAcrossProfiles(true);
|
||||||
refreshUi();
|
refreshUi();
|
||||||
if (launchedByApp()) {
|
if (mIsPageLaunchedByApp) {
|
||||||
setIntentAndFinish(/* appChanged= */ true);
|
setIntentAndFinish(/* appChanged= */ true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user