Merge "1b/ Replace removed shared lib calls with direct calls" into tm-dev am: 78166e9337
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17003266 Change-Id: I1934c8b54f775d0ab52b346e036e7d671d14c7c6
This commit is contained in:
@@ -23,6 +23,7 @@ import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTR
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.app.WallpaperManager;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemProperties;
|
||||
import android.util.FloatProperty;
|
||||
@@ -42,7 +43,6 @@ import com.android.launcher3.anim.PendingAnimation;
|
||||
import com.android.launcher3.statemanager.StateManager.StateHandler;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.systemui.shared.system.BlurUtils;
|
||||
import com.android.systemui.shared.system.WallpaperManagerCompat;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.function.Consumer;
|
||||
@@ -127,7 +127,7 @@ public class DepthController implements StateHandler<LauncherState>,
|
||||
*/
|
||||
private int mMaxBlurRadius;
|
||||
private boolean mCrossWindowBlursEnabled;
|
||||
private WallpaperManagerCompat mWallpaperManager;
|
||||
private WallpaperManager mWallpaperManager;
|
||||
private SurfaceControl mSurface;
|
||||
/**
|
||||
* How visible the -1 overlay is, from 0 to 1.
|
||||
@@ -168,7 +168,7 @@ public class DepthController implements StateHandler<LauncherState>,
|
||||
private void ensureDependencies() {
|
||||
if (mWallpaperManager == null) {
|
||||
mMaxBlurRadius = mLauncher.getResources().getInteger(R.integer.max_depth_blur_radius);
|
||||
mWallpaperManager = new WallpaperManagerCompat(mLauncher);
|
||||
mWallpaperManager = mLauncher.getSystemService(WallpaperManager.class);
|
||||
}
|
||||
|
||||
if (mLauncher.getRootView() != null && mOnAttachListener == null) {
|
||||
|
||||
@@ -66,8 +66,6 @@ import com.android.launcher3.shortcuts.DeepShortcutView;
|
||||
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
|
||||
import com.android.launcher3.util.LauncherBindableItemsContainer;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.system.ClipDescriptionCompat;
|
||||
import com.android.systemui.shared.system.LauncherAppsCompat;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Arrays;
|
||||
@@ -314,13 +312,13 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
|
||||
clipDescription = new ClipDescription(item.title,
|
||||
new String[] {
|
||||
item.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT
|
||||
? ClipDescriptionCompat.MIMETYPE_APPLICATION_SHORTCUT
|
||||
: ClipDescriptionCompat.MIMETYPE_APPLICATION_ACTIVITY
|
||||
? ClipDescription.MIMETYPE_APPLICATION_SHORTCUT
|
||||
: ClipDescription.MIMETYPE_APPLICATION_ACTIVITY
|
||||
});
|
||||
intent = new Intent();
|
||||
if (item.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
|
||||
String deepShortcutId = ((WorkspaceItemInfo) item).getDeepShortcutId();
|
||||
intent.putExtra(ClipDescriptionCompat.EXTRA_PENDING_INTENT,
|
||||
intent.putExtra(ClipDescription.EXTRA_PENDING_INTENT,
|
||||
launcherApps.getShortcutIntent(
|
||||
item.getIntent().getPackage(),
|
||||
deepShortcutId,
|
||||
@@ -329,19 +327,19 @@ public class TaskbarDragController extends DragController<BaseTaskbarContext> im
|
||||
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, item.getIntent().getPackage());
|
||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ID, deepShortcutId);
|
||||
} else {
|
||||
intent.putExtra(ClipDescriptionCompat.EXTRA_PENDING_INTENT,
|
||||
LauncherAppsCompat.getMainActivityLaunchIntent(launcherApps,
|
||||
item.getIntent().getComponent(), null, item.user));
|
||||
intent.putExtra(ClipDescription.EXTRA_PENDING_INTENT,
|
||||
launcherApps.getMainActivityLaunchIntent(item.getIntent().getComponent(),
|
||||
null, item.user));
|
||||
}
|
||||
intent.putExtra(Intent.EXTRA_USER, item.user);
|
||||
} else if (tag instanceof Task) {
|
||||
Task task = (Task) tag;
|
||||
clipDescription = new ClipDescription(task.titleDescription,
|
||||
new String[] {
|
||||
ClipDescriptionCompat.MIMETYPE_APPLICATION_TASK
|
||||
ClipDescription.MIMETYPE_APPLICATION_TASK
|
||||
});
|
||||
intent = new Intent();
|
||||
intent.putExtra(ClipDescriptionCompat.EXTRA_TASK_ID, task.key.id);
|
||||
intent.putExtra(Intent.EXTRA_TASK_ID, task.key.id);
|
||||
intent.putExtra(Intent.EXTRA_USER, UserHandle.of(task.key.userId));
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -35,7 +35,6 @@ import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.notification.NotificationListener;
|
||||
import com.android.launcher3.util.ShortcutUtil;
|
||||
import com.android.quickstep.SystemUiProxy;
|
||||
import com.android.systemui.shared.system.LauncherAppsCompat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -94,8 +93,7 @@ public class TaskbarShortcutMenuAccessibilityDelegate
|
||||
info.user);
|
||||
} else {
|
||||
SystemUiProxy.INSTANCE.get(mContext).startIntent(
|
||||
LauncherAppsCompat.getMainActivityLaunchIntent(
|
||||
mLauncherApps,
|
||||
mLauncherApps.getMainActivityLaunchIntent(
|
||||
item.getIntent().getComponent(),
|
||||
/* startActivityOptions= */null,
|
||||
item.user),
|
||||
|
||||
@@ -23,11 +23,11 @@ import android.os.Build;
|
||||
import android.os.RemoteException;
|
||||
import android.os.UserManager;
|
||||
import android.util.Log;
|
||||
import android.view.ThreadedRenderer;
|
||||
|
||||
import com.android.launcher3.BuildConfig;
|
||||
import com.android.launcher3.MainProcessInitializer;
|
||||
import com.android.systemui.shared.system.InteractionJankMonitorWrapper;
|
||||
import com.android.systemui.shared.system.ThreadedRendererCompat;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@TargetApi(Build.VERSION_CODES.R)
|
||||
@@ -60,8 +60,8 @@ public class QuickstepProcessInitializer extends MainProcessInitializer {
|
||||
super.init(context);
|
||||
|
||||
// Elevate GPU priority for Quickstep and Remote animations.
|
||||
ThreadedRendererCompat.setContextPriority(
|
||||
ThreadedRendererCompat.EGL_CONTEXT_PRIORITY_HIGH_IMG);
|
||||
ThreadedRenderer.setContextPriority(
|
||||
ThreadedRenderer.EGL_CONTEXT_PRIORITY_HIGH_IMG);
|
||||
|
||||
// Enable binder tracing on system server for calls originating from Launcher
|
||||
try {
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.quickstep;
|
||||
import static com.android.launcher3.uioverrides.QuickstepLauncher.GO_LOW_RAM_RECENTS_ENABLED;
|
||||
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.ActivityManager.TaskDescription;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ActivityInfo;
|
||||
@@ -48,7 +49,6 @@ import com.android.quickstep.util.TaskKeyLruCache;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.recents.model.Task.TaskKey;
|
||||
import com.android.systemui.shared.system.PackageManagerWrapper;
|
||||
import com.android.systemui.shared.system.TaskDescriptionCompat;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.function.Consumer;
|
||||
@@ -154,7 +154,7 @@ public class TaskIconCache implements DisplayInfoChangeListener {
|
||||
|
||||
// Load icon
|
||||
// TODO: Load icon resource (b/143363444)
|
||||
Bitmap icon = TaskDescriptionCompat.getIcon(desc, key.userId);
|
||||
Bitmap icon = getIcon(desc, key.userId);
|
||||
if (icon != null) {
|
||||
entry.icon = getBitmapInfo(
|
||||
new BitmapDrawable(mContext.getResources(), icon),
|
||||
@@ -193,6 +193,14 @@ public class TaskIconCache implements DisplayInfoChangeListener {
|
||||
return entry;
|
||||
}
|
||||
|
||||
private Bitmap getIcon(ActivityManager.TaskDescription desc, int userId) {
|
||||
if (desc.getInMemoryIcon() != null) {
|
||||
return desc.getInMemoryIcon();
|
||||
}
|
||||
return ActivityManager.TaskDescription.loadTaskDescriptionIcon(
|
||||
desc.getIconFilename(), userId);
|
||||
}
|
||||
|
||||
private String getBadgedContentDescription(ActivityInfo info, int userId, TaskDescription td) {
|
||||
PackageManager pm = mContext.getPackageManager();
|
||||
String taskLabel = td == null ? null : Utilities.trim(td.getLabel());
|
||||
|
||||
@@ -258,9 +258,8 @@ public interface TaskShortcutFactory {
|
||||
|
||||
@Override
|
||||
protected ActivityOptions makeLaunchOptions(Activity activity) {
|
||||
final ActivityCompat act = new ActivityCompat(activity);
|
||||
final int navBarPosition = WindowManagerWrapper.getInstance().getNavBarPosition(
|
||||
act.getDisplayId());
|
||||
activity.getDisplayId());
|
||||
if (navBarPosition == WindowManagerWrapper.NAV_BAR_POS_INVALID) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,8 @@ import android.view.View;
|
||||
import android.view.ViewRootImpl;
|
||||
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.systemui.shared.system.ViewRootImplCompat;
|
||||
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.function.LongConsumer;
|
||||
|
||||
/**
|
||||
* Utility class for helpful methods related to {@link View} objects.
|
||||
|
||||
Reference in New Issue
Block a user