diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java index 24656d0865..80de8f1a3c 100644 --- a/src/com/android/launcher3/popup/SystemShortcut.java +++ b/src/com/android/launcher3/popup/SystemShortcut.java @@ -8,6 +8,7 @@ import android.content.Context; import android.content.Intent; import android.graphics.Rect; import android.view.View; +import android.view.InflateException; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.ImageView; import android.widget.TextView; @@ -188,25 +189,22 @@ public abstract class SystemShortcut extend } } - private InfoBottomSheet cbs; @Override public void onClick(View view) { -/* + InfoBottomSheet cbs; dismissTaskMenuView(mTarget); Rect sourceBounds = Utilities.getViewBounds(view); - new PackageManagerHelper(mTarget).startDetailsActivityForInfo( - mItemInfo, sourceBounds, ActivityOptions.makeBasic().toBundle()); -*/ - if (cbs == null) { - dismissTaskMenuView(mTarget); - Rect sourceBounds = Utilities.getViewBounds(view); + try { cbs = (InfoBottomSheet) mTarget.getLayoutInflater().inflate( R.layout.app_info_bottom_sheet, mTarget.getDragLayer(), false); cbs.configureBottomSheet(sourceBounds, mTarget); cbs.populateAndShow(mItemInfo); + } catch (InflateException e) { + new PackageManagerHelper(mTarget).startDetailsActivityForInfo( + mItemInfo, sourceBounds, ActivityOptions.makeBasic().toBundle()); } mTarget.getStatsLogManager().logger().withItemInfo(mItemInfo)