Loading core/java/android/appwidget/AppWidgetHostView.java +19 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.appwidget; import android.content.ComponentName; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.LauncherApps; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; Loading Loading @@ -150,7 +151,7 @@ public class AppWidgetHostView extends FrameLayout { // We add padding to the AppWidgetHostView if necessary Rect padding = getDefaultPaddingForWidget(mContext, info.provider, null); setPadding(padding.left, padding.top, padding.right, padding.bottom); setContentDescription(info.label); updateContentDescription(info); } } Loading Loading @@ -459,6 +460,7 @@ public class AppWidgetHostView extends FrameLayout { } applyContent(content, recycled, exception); updateContentDescription(mInfo); } private void applyContent(View content, boolean recycled, Exception exception) { Loading Loading @@ -493,6 +495,22 @@ public class AppWidgetHostView extends FrameLayout { } } private void updateContentDescription(AppWidgetProviderInfo info) { if (info != null) { LauncherApps launcherApps = getContext().getSystemService(LauncherApps.class); ApplicationInfo appInfo = launcherApps.getApplicationInfo( info.provider.getPackageName(), 0, info.getProfile()); if (appInfo != null && (appInfo.flags & ApplicationInfo.FLAG_SUSPENDED) != 0) { setContentDescription( Resources.getSystem().getString( com.android.internal.R.string.suspended_widget_accessibility, info.label)); } else { setContentDescription(info.label); } } } private void inflateAsync(RemoteViews remoteViews) { // Prepare a local reference to the remote Context so we're ready to // inflate any requested LayoutParams. Loading core/res/res/layout/work_widget_mask_view.xml +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ Copyright (C) 2015 The Android Open Source Project android:layout_width="match_parent" android:layout_height="match_parent" android:background="#F3374248" android:importantForAccessibility="noHideDescendants" android:clickable="true"> <ImageView android:id="@+id/work_widget_app_icon" Loading core/res/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4317,4 +4317,7 @@ <!-- Description of notification shown when device has been forced to safe mode after a security compromise. --> <string name="audit_safemode_notification_details">Touch to learn more.</string> <!-- Accessibilty string added to a widget that has been suspended [CHAR LIMIT=20] --> <string name="suspended_widget_accessibility">Suspended <xliff:g id="label" example="Calendar">%1$s</xliff:g></string> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2595,4 +2595,5 @@ <!-- Pinner Service --> <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="string" name="suspended_widget_accessibility" /> </resources> Loading
core/java/android/appwidget/AppWidgetHostView.java +19 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.appwidget; import android.content.ComponentName; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.LauncherApps; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; Loading Loading @@ -150,7 +151,7 @@ public class AppWidgetHostView extends FrameLayout { // We add padding to the AppWidgetHostView if necessary Rect padding = getDefaultPaddingForWidget(mContext, info.provider, null); setPadding(padding.left, padding.top, padding.right, padding.bottom); setContentDescription(info.label); updateContentDescription(info); } } Loading Loading @@ -459,6 +460,7 @@ public class AppWidgetHostView extends FrameLayout { } applyContent(content, recycled, exception); updateContentDescription(mInfo); } private void applyContent(View content, boolean recycled, Exception exception) { Loading Loading @@ -493,6 +495,22 @@ public class AppWidgetHostView extends FrameLayout { } } private void updateContentDescription(AppWidgetProviderInfo info) { if (info != null) { LauncherApps launcherApps = getContext().getSystemService(LauncherApps.class); ApplicationInfo appInfo = launcherApps.getApplicationInfo( info.provider.getPackageName(), 0, info.getProfile()); if (appInfo != null && (appInfo.flags & ApplicationInfo.FLAG_SUSPENDED) != 0) { setContentDescription( Resources.getSystem().getString( com.android.internal.R.string.suspended_widget_accessibility, info.label)); } else { setContentDescription(info.label); } } } private void inflateAsync(RemoteViews remoteViews) { // Prepare a local reference to the remote Context so we're ready to // inflate any requested LayoutParams. Loading
core/res/res/layout/work_widget_mask_view.xml +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ Copyright (C) 2015 The Android Open Source Project android:layout_width="match_parent" android:layout_height="match_parent" android:background="#F3374248" android:importantForAccessibility="noHideDescendants" android:clickable="true"> <ImageView android:id="@+id/work_widget_app_icon" Loading
core/res/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -4317,4 +4317,7 @@ <!-- Description of notification shown when device has been forced to safe mode after a security compromise. --> <string name="audit_safemode_notification_details">Touch to learn more.</string> <!-- Accessibilty string added to a widget that has been suspended [CHAR LIMIT=20] --> <string name="suspended_widget_accessibility">Suspended <xliff:g id="label" example="Calendar">%1$s</xliff:g></string> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -2595,4 +2595,5 @@ <!-- Pinner Service --> <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="string" name="suspended_widget_accessibility" /> </resources>