diff options
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 8492a7985..1e12b423f 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -113,7 +113,6 @@ import com.android.launcher3.pageindicators.PageIndicator; import com.android.launcher3.popup.PopupContainerWithArrow; import com.android.launcher3.popup.PopupDataProvider; import com.android.launcher3.shortcuts.DeepShortcutManager; -import com.android.launcher3.shortcuts.ShortcutKey; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.launcher3.userevent.nano.LauncherLogProto.Action; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; @@ -121,6 +120,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType; import com.android.launcher3.util.ActivityResultInfo; import com.android.launcher3.util.RunnableWithId; import com.android.launcher3.util.ComponentKey; +import com.android.launcher3.util.ComponentKeyMapper; import com.android.launcher3.util.ItemInfoMatcher; import com.android.launcher3.util.MultiHashMap; import com.android.launcher3.util.PackageManagerHelper; @@ -272,7 +272,6 @@ public class Launcher extends BaseActivity private IconCache mIconCache; private LauncherAccessibilityDelegate mAccessibilityDelegate; private final Handler mHandler = new Handler(); - private boolean mIsResumeFromActionScreenOff; private boolean mHasFocus = false; private ObjectAnimator mScrimAnimator; @@ -280,8 +279,6 @@ public class Launcher extends BaseActivity private PopupDataProvider mPopupDataProvider; - private View.OnTouchListener mHapticFeedbackTouchListener; - // Determines how long to wait after a rotation before restoring the screen orientation to // match the sensor state. private static final int RESTORE_SCREEN_ORIENTATION_DELAY = 500; @@ -1046,7 +1043,6 @@ public class Launcher extends BaseActivity if (shouldShowDiscoveryBounce()) { mAllAppsController.showDiscoveryBounce(); } - mIsResumeFromActionScreenOff = false; if (mLauncherCallbacks != null) { mLauncherCallbacks.onResume(); } @@ -1134,7 +1130,7 @@ public class Launcher extends BaseActivity // On O and above we there is always some setting present settings (add icon to // home screen or icon badging). On earlier APIs we will have the allow rotation // setting, on devices with a locked orientation, - return Utilities.isAtLeastO() || !getResources().getBoolean(R.bool.allow_rotation); + return Utilities.ATLEAST_OREO || !getResources().getBoolean(R.bool.allow_rotation); } } @@ -1328,7 +1324,6 @@ public class Launcher extends BaseActivity onClickWallpaperPicker(view); } }.attachTo(wallpaperButton); - wallpaperButton.setOnTouchListener(getHapticFeedbackTouchListener()); // Bind widget button actions mWidgetsButton = findViewById(R.id.widget_button); @@ -1338,7 +1333,6 @@ public class Launcher extends BaseActivity onClickAddWidgetButton(view); } }.attachTo(mWidgetsButton); - mWidgetsButton.setOnTouchListener(getHapticFeedbackTouchListener()); // Bind settings actions View settingsButton = findViewById(R.id.settings_button); @@ -1350,7 +1344,6 @@ public class Launcher extends BaseActivity onClickSettingsButton(view); } }.attachTo(settingsButton); - settingsButton.setOnTouchListener(getHapticFeedbackTouchListener()); } else { settingsButton.setVisibility(View.GONE); } @@ -1416,7 +1409,7 @@ public class Launcher extends BaseActivity CellLayout layout = getCellLayout(container, screenId); ShortcutInfo info = null; - if (Utilities.isAtLeastO()) { + if (Utilities.ATLEAST_OREO) { info = LauncherAppsCompatVO.createShortcutInfoFromPinItemRequest( this, LauncherAppsCompatVO.getPinItemRequest(data), 0); } @@ -1548,7 +1541,6 @@ public class Launcher extends BaseActivity mAppsView.reset(); } } - mIsResumeFromActionScreenOff = true; mShouldFadeInScrim = true; } else if (Intent.ACTION_USER_PRESENT.equals(action)) { // ACTION_USER_PRESENT is sent after onStart/onResume. This covers the case where @@ -2424,7 +2416,7 @@ public class Launcher extends BaseActivity } // Check for abandoned promise - if ((v instanceof BubbleTextView) && shortcut.isPromise()) { + if ((v instanceof BubbleTextView) && shortcut.hasPromiseIconUi()) { String packageName = shortcut.intent.getComponent() != null ? shortcut.intent.getComponent().getPackageName() : shortcut.intent.getPackage(); if (!TextUtils.isEmpty(packageName)) { @@ -2536,22 +2528,6 @@ public class Launcher extends BaseActivity startActivity(intent, getActivityLaunchOptions(v)); } - public View.OnTouchListener getHapticFeedbackTouchListener() { - if (mHapticFeedbackTouchListener == null) { - mHapticFeedbackTouchListener = new View.OnTouchListener() { - @SuppressLint("ClickableViewAccessibility") - @Override - public boolean onTouch(View v, MotionEvent event) { - if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) { - v.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); - } - return false; - } - }; - } - return mHapticFeedbackTouchListener; - } - @Override public void onAccessibilityStateChanged(boolean enabled) { mDragLayer.onAccessibilityStateChanged(enabled); @@ -3068,7 +3044,7 @@ public class Launcher extends BaseActivity */ public void tryAndUpdatePredictedApps() { if (mLauncherCallbacks != null) { - List<ComponentKey> apps = mLauncherCallbacks.getPredictedApps(); + List<ComponentKeyMapper<AppInfo>> apps = mLauncherCallbacks.getPredictedApps(); if (apps != null) { mAppsView.setPredictedApps(apps); } @@ -3910,16 +3886,7 @@ public class Launcher extends BaseActivity } private boolean shouldShowDiscoveryBounce() { - if (mState != State.WORKSPACE) { - return false; - } - if (mLauncherCallbacks != null && mLauncherCallbacks.shouldShowDiscoveryBounce()) { - return true; - } - if (!mIsResumeFromActionScreenOff) { - return false; - } - return !mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false); + return mState == State.WORKSPACE && !mSharedPrefs.getBoolean(APPS_VIEW_SHOWN, false); } protected void moveWorkspaceToDefaultScreen() { |