From a55b11c6fc1a8ac577d512daf91ec18353b98fbe Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 14 Jul 2022 18:50:17 +0000 Subject: [PATCH] Removing unused shared lib code Bug: 219861883 Test: Builds Change-Id: I60d47ce41f44cd0aa0c56cf3c4ad9ba4958e556b --- .../shared/system/ActivityManagerWrapper.java | 40 ------------ .../shared/system/ActivityOptionsCompat.java | 8 --- .../shared/system/QuickStepContract.java | 22 ------- .../system/UniversalSmartspaceUtils.java | 44 ------------- .../shared/system/WindowManagerWrapper.java | 63 ------------------- 5 files changed, 177 deletions(-) delete mode 100644 packages/SystemUI/shared/src/com/android/systemui/shared/system/UniversalSmartspaceUtils.java diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java index c5beaa7ee0b16..916526d0efac6 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityManagerWrapper.java @@ -129,13 +129,6 @@ public class ActivityManagerWrapper { return tasks.toArray(new RunningTaskInfo[tasks.size()]); } - /** - * @return a list of the recents tasks. - */ - public List getRecentTasks(int numTasks, int userId) { - return mAtm.getRecentTasks(numTasks, RECENT_IGNORE_UNAVAILABLE, userId); - } - /** * @return a {@link ThumbnailData} with {@link TaskSnapshot} for the given {@param taskId}. * The snapshot will be triggered if no cached {@link TaskSnapshot} exists. @@ -246,25 +239,6 @@ public class ActivityManagerWrapper { } } - /** - * Starts a task from Recents. - * - * @param resultCallback The result success callback - * @param resultCallbackHandler The handler to receive the result callback - */ - public void startActivityFromRecentsAsync(Task.TaskKey taskKey, ActivityOptions options, - Consumer resultCallback, Handler resultCallbackHandler) { - final boolean result = startActivityFromRecents(taskKey, options); - if (resultCallback != null) { - resultCallbackHandler.post(new Runnable() { - @Override - public void run() { - resultCallback.accept(result); - } - }); - } - } - /** * Starts a task from Recents synchronously. */ @@ -285,20 +259,6 @@ public class ActivityManagerWrapper { } } - /** - * @deprecated use {@link TaskStackChangeListeners#registerTaskStackListener} - */ - public void registerTaskStackListener(TaskStackChangeListener listener) { - TaskStackChangeListeners.getInstance().registerTaskStackListener(listener); - } - - /** - * @deprecated use {@link TaskStackChangeListeners#unregisterTaskStackListener} - */ - public void unregisterTaskStackListener(TaskStackChangeListener listener) { - TaskStackChangeListeners.getInstance().unregisterTaskStackListener(listener); - } - /** * Requests that the system close any open system windows (including other SystemUI). */ diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java index add2d022e893f..be99b270c09ae 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/ActivityOptionsCompat.java @@ -27,14 +27,6 @@ import android.os.Handler; */ public abstract class ActivityOptionsCompat { - /** - * @Deprecated - * @return ActivityOptions for starting a task in split screen as the primary window. - */ - public static ActivityOptions makeSplitScreenOptions(boolean dockTopLeft) { - return ActivityOptions.makeBasic(); - } - /** * @return ActivityOptions for starting a task in freeform. */ diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java index 630fb360cc14b..97e0242387789 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java @@ -203,28 +203,6 @@ public class QuickStepContract { return QUICKSTEP_TOUCH_SLOP_RATIO * ViewConfiguration.get(context).getScaledTouchSlop(); } - /** - * Touch slopes and thresholds for quick step operations. Drag slop is the point where the - * home button press/long press over are ignored and will start to drag when exceeded and the - * touch slop is when the respected operation will occur when exceeded. Touch slop must be - * larger than the drag slop. - */ - public static int getQuickStepDragSlopPx() { - return convertDpToPixel(10); - } - - public static int getQuickStepTouchSlopPx() { - return convertDpToPixel(24); - } - - public static int getQuickScrubTouchSlopPx() { - return convertDpToPixel(24); - } - - private static int convertDpToPixel(float dp) { - return (int) (dp * Resources.getSystem().getDisplayMetrics().density); - } - /** * Returns whether the specified sysui state is such that the assistant gesture should be * disabled. diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/UniversalSmartspaceUtils.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/UniversalSmartspaceUtils.java deleted file mode 100644 index 359d36939b313..0000000000000 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/UniversalSmartspaceUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2020 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.systemui.shared.system; - -import android.content.Intent; -import android.os.Bundle; -import android.view.SurfaceView; - -/** Utility class that is shared between SysUI and Launcher for Universal Smartspace features. */ -public final class UniversalSmartspaceUtils { - public static final String ACTION_REQUEST_SMARTSPACE_VIEW = - "com.android.systemui.REQUEST_SMARTSPACE_VIEW"; - public static final String INTENT_BUNDLE_KEY = "bundle_key"; - - private static final String SYSUI_PACKAGE = "com.android.systemui"; - - /** Creates an intent to request that sysui draws the Smartspace to the SurfaceView. */ - public static Intent createRequestSmartspaceIntent(SurfaceView surfaceView) { - Intent intent = new Intent(ACTION_REQUEST_SMARTSPACE_VIEW); - - Bundle bundle = SurfaceViewRequestUtils.createSurfaceBundle(surfaceView); - return intent - .putExtra(INTENT_BUNDLE_KEY, bundle) - .setPackage(SYSUI_PACKAGE) - .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY - | Intent.FLAG_RECEIVER_FOREGROUND); - } - - private UniversalSmartspaceUtils() {} -} diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java index b894b10ff0735..5577513f4c3c3 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/WindowManagerWrapper.java @@ -113,30 +113,6 @@ public class WindowManagerWrapper { } } - /** - * Sets if app requested fixed orientation should be ignored for given displayId. - */ - public void setIgnoreOrientationRequest(int displayId, boolean ignoreOrientationRequest) { - try { - WindowManagerGlobal.getWindowManagerService().setIgnoreOrientationRequest( - displayId, ignoreOrientationRequest); - } catch (RemoteException e) { - Log.e(TAG, "Failed to setIgnoreOrientationRequest()", e); - } - } - - /** - * @return the stable insets for the primary display. - */ - public void getStableInsets(Rect outStableInsets) { - try { - WindowManagerGlobal.getWindowManagerService().getStableInsets(DEFAULT_DISPLAY, - outStableInsets); - } catch (RemoteException e) { - Log.e(TAG, "Failed to get stable insets", e); - } - } - /** * Overrides a pending app transition. */ @@ -153,16 +129,6 @@ public class WindowManagerWrapper { } } - public void overridePendingAppTransitionRemote( - RemoteAnimationAdapterCompat remoteAnimationAdapter, int displayId) { - try { - WindowManagerGlobal.getWindowManagerService().overridePendingAppTransitionRemote( - remoteAnimationAdapter.getWrapped(), displayId); - } catch (RemoteException e) { - Log.w(TAG, "Failed to override pending app transition (remote): ", e); - } - } - /** * Enable or disable haptic feedback on the navigation bar buttons. */ @@ -175,19 +141,6 @@ public class WindowManagerWrapper { } } - public void setRecentsVisibility(boolean visible) { - try { - WindowManagerGlobal.getWindowManagerService().setRecentsVisibility(visible); - } catch (RemoteException e) { - Log.w(TAG, "Failed to set recents visibility"); - } - } - - @Deprecated - public void setPipVisibility(final boolean visible) { - // To be removed - } - /** * @param displayId the id of display to check if there is a software navigation bar. * @@ -201,22 +154,6 @@ public class WindowManagerWrapper { } } - /** - * @return The side of the screen where navigation bar is positioned. - * @see #NAV_BAR_POS_RIGHT - * @see #NAV_BAR_POS_LEFT - * @see #NAV_BAR_POS_BOTTOM - * @see #NAV_BAR_POS_INVALID - */ - public int getNavBarPosition(int displayId) { - try { - return WindowManagerGlobal.getWindowManagerService().getNavBarPosition(displayId); - } catch (RemoteException e) { - Log.w(TAG, "Failed to get nav bar position"); - } - return NAV_BAR_POS_INVALID; - } - /** * Mirrors a specified display. The SurfaceControl returned is the root of the mirrored * hierarchy.