From cc4f6f2425b71dbf07a23351dfa003e16e52a5bf Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Tue, 19 May 2020 15:50:37 -0400 Subject: [PATCH] App Pinning strings; security notes on startup dialog. Bug: 151332926 Test: manual, visual Change-Id: Ic3e83f1bf4451afe5fe7f21827388f91b0b87378 --- packages/SystemUI/res/values/dimens.xml | 2 ++ packages/SystemUI/res/values/strings.xml | 16 ++++++++++------ .../systemui/recents/ScreenPinningRequest.java | 18 ++++++++++++++++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index a13451fc2ce00..7f1763d2dec1f 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -907,6 +907,8 @@ 56dp 84dp + + 6sp diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index f7f1ef6f37466..21a2435c04487 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1522,7 +1522,7 @@ Switch output device - Screen is pinned + App is pinned This keeps it in view until you unpin. Touch & hold Back and Overview to unpin. This keeps it in view until you unpin. Touch & hold Back and Home to unpin. @@ -1530,20 +1530,24 @@ This keeps it in view until you unpin. Touch & hold Overview to unpin. This keeps it in view until you unpin. Touch & hold Home to unpin. + + Personal data may be accessible (such as contacts and email content). + + Pinned app may open other apps. - To unpin this screen, touch & hold Back and Overview + To unpin this app, touch & hold Back and Overview buttons - To unpin this screen, touch & hold Back + To unpin this app, touch & hold Back and Home buttons - To unpin this screen, swipe up & hold + To unpin this app, swipe up & hold Got it No thanks - Screen pinned - Screen unpinned + App pinned + App unpinned diff --git a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java index fe84d81836e88..387490311644b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +++ b/packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java @@ -31,6 +31,8 @@ import android.graphics.PixelFormat; import android.graphics.drawable.ColorDrawable; import android.os.Binder; import android.os.RemoteException; +import android.text.SpannableStringBuilder; +import android.text.style.BulletSpan; import android.util.DisplayMetrics; import android.view.Gravity; import android.view.View; @@ -293,8 +295,20 @@ public class ScreenPinningRequest implements View.OnClickListener, .setImageDrawable(navigationBarView.getHomeDrawable()); } - ((TextView) mLayout.findViewById(R.id.screen_pinning_description)) - .setText(descriptionStringResId); + // Create a bulleted list of the default description plus the two security notes. + int gapWidth = getResources().getDimensionPixelSize( + R.dimen.screen_pinning_description_bullet_gap_width); + SpannableStringBuilder description = new SpannableStringBuilder(); + description.append(getContext().getText(descriptionStringResId), + new BulletSpan(gapWidth), /* flags */ 0); + description.append(System.lineSeparator()); + description.append(getContext().getText(R.string.screen_pinning_exposes_personal_data), + new BulletSpan(gapWidth), /* flags */ 0); + description.append(System.lineSeparator()); + description.append(getContext().getText(R.string.screen_pinning_can_open_other_apps), + new BulletSpan(gapWidth), /* flags */ 0); + ((TextView) mLayout.findViewById(R.id.screen_pinning_description)).setText(description); + final int backBgVisibility = touchExplorationEnabled ? View.INVISIBLE : View.VISIBLE; mLayout.findViewById(R.id.screen_pinning_back_bg).setVisibility(backBgVisibility); mLayout.findViewById(R.id.screen_pinning_back_bg_light).setVisibility(backBgVisibility);