Merge "Ensure that we update the preview layout rule when not animating." into ub-launcher3-calgary
diff --git a/res/values/config.xml b/res/values/config.xml
index bdedff0..c962dec 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -101,4 +101,5 @@
     <item type="id" name="action_move_screen_backwards" />
     <item type="id" name="action_move_screen_forwards" />
     <item type="id" name="action_resize" />
+    <item type="id" name="action_deep_shortcuts" />
 </resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7bd9ff7..757e29d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -249,4 +249,7 @@
     <!-- Accessibility confirmation for widget resize. -->
     <string name="widget_resized">Widget resized to width <xliff:g id="number" example="2">%1$s</xliff:g> height <xliff:g id="number" example="1">%2$s</xliff:g></string>
 
+    <!-- Accessibility action to show quick actions menu for an icon. [CHAR_LIMIT=30] -->
+    <string name="action_deep_shortcut" translatable="false">Quick links</string>
+
 </resources>
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index c0c6673..33b3ad3 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -56,11 +56,12 @@
 
     private static SparseArray<Theme> sPreloaderThemes = new SparseArray<Theme>(2);
 
-    private static final float SHADOW_LARGE_RADIUS = 4.0f;
-    private static final float SHADOW_SMALL_RADIUS = 1.75f;
-    private static final float SHADOW_Y_OFFSET = 2.0f;
-    private static final int SHADOW_LARGE_COLOUR = 0xDD000000;
-    private static final int SHADOW_SMALL_COLOUR = 0xCC000000;
+    // Dimensions in DP
+    private static final float AMBIENT_SHADOW_RADIUS = 2.5f;
+    private static final float KEY_SHADOW_RADIUS = 1f;
+    private static final float KEY_SHADOW_OFFSET = 0.5f;
+    private static final int AMBIENT_SHADOW_COLOR = 0x33000000;
+    private static final int KEY_SHADOW_COLOR = 0x66000000;
 
     private static final int DISPLAY_WORKSPACE = 0;
     private static final int DISPLAY_ALL_APPS = 1;
@@ -136,6 +137,10 @@
             // Draw the background itself as the parent is drawn twice.
             mBackground = getBackground();
             setBackground(null);
+
+            // Set shadow layer as the larger shadow to that the textView does not clip the shadow.
+            float density = getResources().getDisplayMetrics().density;
+            setShadowLayer(density * AMBIENT_SHADOW_RADIUS, 0, 0, AMBIENT_SHADOW_COLOR);
         } else {
             mBackground = null;
         }
@@ -144,10 +149,6 @@
         mStylusEventHelper = new StylusEventHelper(new SimpleOnStylusPressListener(this), this);
 
         mOutlineHelper = HolographicOutlineHelper.obtain(getContext());
-        if (mCustomShadowsEnabled) {
-            setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
-        }
-
         setAccessibilityDelegate(mLauncher.getAccessibilityDelegate());
     }
 
@@ -408,13 +409,15 @@
         }
 
         // We enhance the shadow by drawing the shadow twice
-        getPaint().setShadowLayer(SHADOW_LARGE_RADIUS, 0.0f, SHADOW_Y_OFFSET, SHADOW_LARGE_COLOUR);
+        float density = getResources().getDisplayMetrics().density;
+        getPaint().setShadowLayer(density * AMBIENT_SHADOW_RADIUS, 0, 0, AMBIENT_SHADOW_COLOR);
         super.draw(canvas);
         canvas.save(Canvas.CLIP_SAVE_FLAG);
         canvas.clipRect(getScrollX(), getScrollY() + getExtendedPaddingTop(),
                 getScrollX() + getWidth(),
                 getScrollY() + getHeight(), Region.Op.INTERSECT);
-        getPaint().setShadowLayer(SHADOW_SMALL_RADIUS, 0.0f, 0.0f, SHADOW_SMALL_COLOUR);
+        getPaint().setShadowLayer(
+                density * KEY_SHADOW_RADIUS, 0.0f, density * KEY_SHADOW_OFFSET, KEY_SHADOW_COLOR);
         super.draw(canvas);
         canvas.restore();
     }
@@ -649,6 +652,13 @@
     }
 
     /**
+     * Returns true if the view can show custom shortcuts.
+     */
+    public boolean hasDeepShortcuts() {
+        return !mLauncher.getShortcutIdsForItem((ItemInfo) getTag()).isEmpty();
+    }
+
+    /**
      * Returns the start delay when animating between certain {@link FastBitmapDrawable} states.
      */
     private static int getStartDelayForStateChange(final FastBitmapDrawable.State fromState,
diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
index 6bf8abf..0562cf5 100644
--- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
@@ -18,6 +18,7 @@
 
 import com.android.launcher3.AppInfo;
 import com.android.launcher3.AppWidgetResizeFrame;
+import com.android.launcher3.BubbleTextView;
 import com.android.launcher3.CellLayout;
 import com.android.launcher3.DeleteDropTarget;
 import com.android.launcher3.DragSource;
@@ -36,6 +37,8 @@
 import com.android.launcher3.UninstallDropTarget;
 import com.android.launcher3.Workspace;
 import com.android.launcher3.dragndrop.DragController.DragListener;
+import com.android.launcher3.shortcuts.DeepShortcutTextView;
+import com.android.launcher3.shortcuts.DeepShortcutsContainer;
 import com.android.launcher3.util.Thunk;
 
 import java.util.ArrayList;
@@ -45,13 +48,14 @@
 
     private static final String TAG = "LauncherAccessibilityDelegate";
 
-    private static final int REMOVE = R.id.action_remove;
-    private static final int INFO = R.id.action_info;
-    private static final int UNINSTALL = R.id.action_uninstall;
-    private static final int ADD_TO_WORKSPACE = R.id.action_add_to_workspace;
-    private static final int MOVE = R.id.action_move;
-    private static final int MOVE_TO_WORKSPACE = R.id.action_move_to_workspace;
-    private static final int RESIZE = R.id.action_resize;
+    protected static final int REMOVE = R.id.action_remove;
+    protected static final int INFO = R.id.action_info;
+    protected static final int UNINSTALL = R.id.action_uninstall;
+    protected static final int ADD_TO_WORKSPACE = R.id.action_add_to_workspace;
+    protected static final int MOVE = R.id.action_move;
+    protected static final int MOVE_TO_WORKSPACE = R.id.action_move_to_workspace;
+    protected static final int RESIZE = R.id.action_resize;
+    protected static final int DEEP_SHORTCUTS = R.id.action_deep_shortcuts;
 
     public enum DragType {
         ICON,
@@ -65,7 +69,7 @@
         public View item;
     }
 
-    private final SparseArray<AccessibilityAction> mActions = new SparseArray<>();
+    protected final SparseArray<AccessibilityAction> mActions = new SparseArray<>();
     @Thunk final Launcher mLauncher;
 
     private DragInfo mDragInfo = null;
@@ -88,14 +92,24 @@
                 launcher.getText(R.string.action_move_to_workspace)));
         mActions.put(RESIZE, new AccessibilityAction(RESIZE,
                         launcher.getText(R.string.action_resize)));
+        mActions.put(DEEP_SHORTCUTS, new AccessibilityAction(DEEP_SHORTCUTS,
+                launcher.getText(R.string.action_deep_shortcut)));
     }
 
     @Override
     public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(host, info);
+        addActions(host, info);
+    }
+
+    protected void addActions(View host, AccessibilityNodeInfo info) {
         if (!(host.getTag() instanceof ItemInfo)) return;
         ItemInfo item = (ItemInfo) host.getTag();
 
+        if (host instanceof BubbleTextView && ((BubbleTextView) host).hasDeepShortcuts()) {
+            info.addAction(mActions.get(DEEP_SHORTCUTS));
+        }
+
         if (DeleteDropTarget.supportsAccessibleDrop(item)) {
             info.addAction(mActions.get(REMOVE));
         }
@@ -215,6 +229,9 @@
                     }
                 })
                 .show();
+            return true;
+        } else if (action == DEEP_SHORTCUTS) {
+            return DeepShortcutsContainer.showForIcon((BubbleTextView) host) != null;
         }
         return false;
     }
@@ -397,7 +414,7 @@
     /**
      * Find empty space on the workspace and returns the screenId.
      */
-    private long findSpaceOnWorkspace(ItemInfo info, int[] outCoordinates) {
+    protected long findSpaceOnWorkspace(ItemInfo info, int[] outCoordinates) {
         Workspace workspace = mLauncher.getWorkspace();
         ArrayList<Long> workspaceScreens = workspace.getScreenOrder();
         long screenId;
diff --git a/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java
new file mode 100644
index 0000000..ff70279
--- /dev/null
+++ b/src/com/android/launcher3/accessibility/ShortcutMenuAccessibilityDelegate.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.accessibility;
+
+import android.view.View;
+import android.view.accessibility.AccessibilityNodeInfo;
+
+import com.android.launcher3.ItemInfo;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherModel;
+import com.android.launcher3.LauncherSettings;
+import com.android.launcher3.R;
+import com.android.launcher3.ShortcutInfo;
+
+import java.util.ArrayList;
+
+/**
+ * Extension of {@link LauncherAccessibilityDelegate} with actions specific to shortcuts in
+ * deep shortcuts menu.
+ */
+public class ShortcutMenuAccessibilityDelegate extends LauncherAccessibilityDelegate {
+
+    public ShortcutMenuAccessibilityDelegate(Launcher launcher) {
+        super(launcher);
+    }
+
+    @Override
+    protected void addActions(View host, AccessibilityNodeInfo info) {
+        info.addAction(mActions.get(ADD_TO_WORKSPACE));
+    }
+
+    @Override
+    public boolean performAction(View host, ItemInfo item, int action) {
+        if (action == ADD_TO_WORKSPACE) {
+            final ShortcutInfo info = (ShortcutInfo) item;
+            final int[] coordinates = new int[2];
+            final long screenId = findSpaceOnWorkspace(item, coordinates);
+            Runnable onComplete = new Runnable() {
+                @Override
+                public void run() {
+                    LauncherModel.addItemToDatabase(mLauncher, info,
+                            LauncherSettings.Favorites.CONTAINER_DESKTOP,
+                            screenId, coordinates[0], coordinates[1]);
+                    ArrayList<ItemInfo> itemList = new ArrayList<>();
+                    itemList.add(info);
+                    mLauncher.bindItems(itemList, 0, itemList.size(), true);
+                    mLauncher.closeShortcutsContainer();
+                    announceConfirmation(R.string.item_added_to_workspace);
+                }
+            };
+
+            if (!mLauncher.showWorkspace(true, onComplete)) {
+                onComplete.run();
+            }
+            return true;
+        }
+        return false;
+    }
+}
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 8b1f950..428f784 100644
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -210,6 +210,7 @@
      */
     public void addApps(List<AppInfo> apps) {
         mApps.addApps(apps);
+        mSearchBarController.refreshSearchResult();
     }
 
     /**
@@ -217,6 +218,7 @@
      */
     public void updateApps(List<AppInfo> apps) {
         mApps.updateApps(apps);
+        mSearchBarController.refreshSearchResult();
     }
 
     /**
@@ -224,6 +226,7 @@
      */
     public void removeApps(List<AppInfo> apps) {
         mApps.removeApps(apps);
+        mSearchBarController.refreshSearchResult();
     }
 
     public void setSearchBarVisible(boolean visible) {
diff --git a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
index ac35932..e75210b 100644
--- a/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
+++ b/src/com/android/launcher3/allapps/AllAppsSearchBarController.java
@@ -45,6 +45,7 @@
     protected AlphabeticalAppsList mApps;
     protected Callbacks mCb;
     protected ExtendedEditText mInput;
+    private String mQuery;
 
     protected DefaultAppSearchAlgorithm mSearchAlgorithm;
     protected InputMethodManager mInputMethodManager;
@@ -90,16 +91,25 @@
 
     @Override
     public void afterTextChanged(final Editable s) {
-        String query = s.toString();
-        if (query.isEmpty()) {
+        mQuery = s.toString();
+        if (mQuery.isEmpty()) {
             mSearchAlgorithm.cancel(true);
             mCb.clearSearchResult();
         } else {
             mSearchAlgorithm.cancel(false);
-            mSearchAlgorithm.doSearch(query, mCb);
+            mSearchAlgorithm.doSearch(mQuery, mCb);
         }
     }
 
+    protected void refreshSearchResult() {
+        if (mQuery == null) {
+            return;
+        }
+        // If play store continues auto updating an app, we want to show partial result.
+        mSearchAlgorithm.cancel(false);
+        mSearchAlgorithm.doSearch(mQuery, mCb);
+    }
+
     @Override
     public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
         // Skip if it's not the right action
@@ -130,6 +140,7 @@
      * Resets the search bar state.
      */
     public void reset() {
+        mQuery = null;
         unfocusSearchField();
         mCb.clearSearchResult();
         mInput.setText("");
diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
index 8091825..fdc0bd2 100644
--- a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
+++ b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
@@ -30,6 +30,7 @@
 import android.os.Looper;
 import android.text.TextUtils;
 import android.util.AttributeSet;
+import android.view.HapticFeedbackConstants;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
@@ -48,6 +49,7 @@
 import com.android.launcher3.ShortcutInfo;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.Workspace;
+import com.android.launcher3.accessibility.ShortcutMenuAccessibilityDelegate;
 import com.android.launcher3.compat.UserHandleCompat;
 import com.android.launcher3.dragndrop.DragController;
 import com.android.launcher3.dragndrop.DragLayer;
@@ -70,10 +72,12 @@
         UserEventDispatcher.LaunchSourceProvider {
     private static final String TAG = "ShortcutsContainer";
 
-    private Launcher mLauncher;
-    private DeepShortcutManager mDeepShortcutsManager;
+    private final Launcher mLauncher;
+    private final DeepShortcutManager mDeepShortcutsManager;
     private final int mDragDeadzone;
     private final int mStartDragThreshold;
+    private final ShortcutMenuAccessibilityDelegate mAccessibilityDelegate;
+
     private BubbleTextView mDeferredDragIcon;
     private int mActivePointerId;
     private int[] mTouchDown = null;
@@ -115,6 +119,7 @@
         mDragDeadzone = ViewConfiguration.get(context).getScaledTouchSlop();
         mStartDragThreshold = getResources().getDimensionPixelSize(
                 R.dimen.deep_shortcuts_start_drag_threshold);
+        mAccessibilityDelegate = new ShortcutMenuAccessibilityDelegate(mLauncher);
     }
 
     public DeepShortcutsContainer(Context context, AttributeSet attrs) {
@@ -128,12 +133,14 @@
     public void populateAndShow(final BubbleTextView originalIcon, final List<String> ids) {
         // Add dummy views first, and populate with real shortcut info when ready.
         final int spacing = getResources().getDimensionPixelSize(R.dimen.deep_shortcuts_spacing);
-        final LayoutInflater inflator = mLauncher.getLayoutInflater();
+        final LayoutInflater inflater = mLauncher.getLayoutInflater();
         for (int i = 0; i < ids.size(); i++) {
-            final View shortcut = inflator.inflate(R.layout.deep_shortcut, this, false);
+            final DeepShortcutView shortcut =
+                    (DeepShortcutView) inflater.inflate(R.layout.deep_shortcut, this, false);
             if (i < ids.size() - 1) {
                 ((LayoutParams) shortcut.getLayoutParams()).bottomMargin = spacing;
             }
+            shortcut.getBubbleText().setAccessibilityDelegate(mAccessibilityDelegate);
             addView(shortcut);
         }
 
@@ -388,6 +395,8 @@
                     break;
                 }
             }
+        } else if (action == MotionEvent.ACTION_CANCEL) {
+            cleanupDeferredDrag();
         }
         return true;
     }
@@ -499,4 +508,26 @@
         // TODO: add target.rank
         targetParent.containerType = LauncherLogProto.DEEPSHORTCUTS;
     }
+
+    /**
+     * Shows the shortcuts container for {@param icon}
+     * @return the container if shown or null.
+     */
+    public static DeepShortcutsContainer showForIcon(BubbleTextView icon) {
+        Launcher launcher = Launcher.getLauncher(icon.getContext());
+        List<String> ids = launcher.getShortcutIdsForItem((ItemInfo) icon.getTag());
+        if (!ids.isEmpty()) {
+            // There are shortcuts associated with the app, so defer its drag.
+            final DeepShortcutsContainer container =
+                    (DeepShortcutsContainer) launcher.getLayoutInflater().inflate(
+                            R.layout.deep_shortcuts_container, launcher.getDragLayer(), false);
+            container.setVisibility(View.INVISIBLE);
+            launcher.getDragLayer().addView(container);
+            container.populateAndShow(icon, ids);
+            icon.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
+                    HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
+            return container;
+        }
+        return null;
+    }
 }
diff --git a/src/com/android/launcher3/shortcuts/ShortcutsContainerListener.java b/src/com/android/launcher3/shortcuts/ShortcutsContainerListener.java
index 962fbac..f94595b 100644
--- a/src/com/android/launcher3/shortcuts/ShortcutsContainerListener.java
+++ b/src/com/android/launcher3/shortcuts/ShortcutsContainerListener.java
@@ -1,9 +1,6 @@
 package com.android.launcher3.shortcuts;
 
-import android.content.Context;
 import android.os.SystemClock;
-import android.view.HapticFeedbackConstants;
-import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewConfiguration;
@@ -11,14 +8,10 @@
 
 import com.android.launcher3.BubbleTextView;
 import com.android.launcher3.CheckLongPressHelper;
-import com.android.launcher3.ItemInfo;
 import com.android.launcher3.Launcher;
-import com.android.launcher3.R;
 import com.android.launcher3.Utilities;
 import com.android.launcher3.dragndrop.DragLayer;
 
-import java.util.List;
-
 /**
  * A {@link android.view.View.OnTouchListener} that creates a {@link DeepShortcutsContainer} and
  * forwards touch events to it. This listener should be put on any icon that supports shortcuts.
@@ -56,6 +49,10 @@
     private final int[] mTouchDown;
     private boolean mHasMappedTouchDownToContainerCoord;
 
+    /** If true, the gesture is not handled. The value is reset when next gesture starts. */
+    private boolean mIgnoreCurrentGesture;
+    private DeepShortcutsContainer mShortcutsContainer;
+
     public ShortcutsContainerListener(BubbleTextView icon) {
         mSrcIcon = icon;
         mScaledTouchSlop = ViewConfiguration.get(icon.getContext()).getScaledTouchSlop();
@@ -72,18 +69,21 @@
 
     @Override
     public boolean onTouch(View v, MotionEvent event) {
-        if (mLauncher.getShortcutIdsForItem((ItemInfo) v.getTag()).isEmpty()) {
-            // There are no shortcuts associated with this item, so return to normal touch handling.
-            return false;
-        }
-
         if (event.getAction() == MotionEvent.ACTION_DOWN) {
+            // There are no shortcuts associated with this item,
+            // so return to normal touch handling.
+            mIgnoreCurrentGesture = !mSrcIcon.hasDeepShortcuts();
+
             mTouchDown[0] = (int) event.getX();
             mTouchDown[1] = (int) event.getY();
             mDragLayer.getDescendantCoordRelativeToSelf(mSrcIcon, mTouchDown);
             mHasMappedTouchDownToContainerCoord = false;
         }
 
+        if (mIgnoreCurrentGesture) {
+            return false;
+        }
+
         final boolean wasForwarding = mForwarding;
         final boolean forwarding;
         if (wasForwarding) {
@@ -127,21 +127,8 @@
      * @return true to start forwarding, false otherwise
      */
     protected boolean onForwardingStarted() {
-        List<String> ids = mLauncher.getShortcutIdsForItem((ItemInfo) mSrcIcon.getTag());
-        if (!ids.isEmpty()) {
-            // There are shortcuts associated with the app, so defer its drag.
-            LayoutInflater layoutInflater = (LayoutInflater) mLauncher.getSystemService
-                    (Context.LAYOUT_INFLATER_SERVICE);
-            final DeepShortcutsContainer deepShortcutsContainer = (DeepShortcutsContainer)
-                    layoutInflater.inflate(R.layout.deep_shortcuts_container, mDragLayer, false);
-            deepShortcutsContainer.setVisibility(View.INVISIBLE);
-            mDragLayer.addView(deepShortcutsContainer);
-            deepShortcutsContainer.populateAndShow(mSrcIcon, ids);
-            mSrcIcon.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
-                    HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING);
-            return true;
-        }
-        return false;
+        mShortcutsContainer = DeepShortcutsContainer.showForIcon(mSrcIcon);
+        return mShortcutsContainer != null;
     }
 
     /**
@@ -150,6 +137,7 @@
      * @return true to stop forwarding, false otherwise
      */
     protected boolean onForwardingStopped() {
+        mShortcutsContainer = null;
         return true;
     }
 
@@ -216,8 +204,8 @@
     private void onLongPress() {
         clearCallbacks();
 
-        final View src = mSrcIcon;
-        if (!src.isEnabled() || mLauncher.getShortcutIdsForItem((ItemInfo) src.getTag()).isEmpty()) {
+        final BubbleTextView src = mSrcIcon;
+        if (!src.isEnabled() || !src.hasDeepShortcuts()) {
             // Ignore long-press if the view is disabled or doesn't have shortcuts.
             return;
         }
@@ -247,8 +235,7 @@
      */
     private boolean onTouchForwarded(MotionEvent srcEvent) {
         final View src = mSrcIcon;
-
-        final DeepShortcutsContainer dst = mLauncher.getOpenShortcutsContainer();
+        final DeepShortcutsContainer dst = mShortcutsContainer;
         if (dst == null) {
             return false;
         }