Merge "Removing some classes/fields not used by either SysUI or Launcher" into udc-qpr-dev

This commit is contained in:
Winson Chung
2023-07-12 23:50:53 +00:00
committed by Android (Google) Code Review
14 changed files with 4 additions and 1041 deletions

View File

@@ -38,8 +38,6 @@ public class ShellSharedConstants {
public static final String KEY_EXTRA_SHELL_RECENT_TASKS = "extra_shell_recent_tasks";
// See IBackAnimation.aidl
public static final String KEY_EXTRA_SHELL_BACK_ANIMATION = "extra_shell_back_animation";
// See IFloatingTasks.aidl
public static final String KEY_EXTRA_SHELL_FLOATING_TASKS = "extra_shell_floating_tasks";
// See IDesktopMode.aidl
public static final String KEY_EXTRA_SHELL_DESKTOP_MODE = "extra_shell_desktop_mode";
// See IDragAndDrop.aidl

View File

@@ -42,8 +42,6 @@ public class QuickStepContract {
"com.google.android.apps.nexuslauncher.NexusLauncherActivity";
public static final String KEY_EXTRA_SYSUI_PROXY = "extra_sysui_proxy";
public static final String KEY_EXTRA_WINDOW_CORNER_RADIUS = "extra_window_corner_radius";
public static final String KEY_EXTRA_SUPPORTS_WINDOW_CORNERS = "extra_supports_window_corners";
public static final String KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER = "extra_unfold_animation";
// See ISysuiUnlockAnimationController.aidl
public static final String KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER = "unlock_animation";

View File

@@ -1,541 +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 static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_LOCKED;
import static android.view.WindowManager.TRANSIT_SLEEP;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.ActivityTaskManager;
import android.app.IApplicationThread;
import android.graphics.Rect;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.ArrayMap;
import android.util.Log;
import android.view.IRecentsAnimationController;
import android.view.RemoteAnimationTarget;
import android.view.SurfaceControl;
import android.window.IRemoteTransition;
import android.window.IRemoteTransitionFinishedCallback;
import android.window.PictureInPictureSurfaceTransaction;
import android.window.RemoteTransition;
import android.window.TaskSnapshot;
import android.window.TransitionInfo;
import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;
import com.android.internal.annotations.VisibleForTesting;
import com.android.wm.shell.util.TransitionUtil;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Helper class to build {@link RemoteTransition} objects
*/
public class RemoteTransitionCompat {
private static final String TAG = "RemoteTransitionCompat";
/** Constructor specifically for recents animation */
public static RemoteTransition newRemoteTransition(RecentsAnimationListener recents,
IApplicationThread appThread) {
IRemoteTransition remote = new IRemoteTransition.Stub() {
final RecentsControllerWrap mRecentsSession = new RecentsControllerWrap();
IBinder mToken = null;
@Override
public void startAnimation(IBinder transition, TransitionInfo info,
SurfaceControl.Transaction t,
IRemoteTransitionFinishedCallback finishedCallback) {
// TODO(b/177438007): Move this set-up logic into launcher's animation impl.
mToken = transition;
mRecentsSession.start(recents, mToken, info, t, finishedCallback);
}
@Override
public void mergeAnimation(IBinder transition, TransitionInfo info,
SurfaceControl.Transaction t, IBinder mergeTarget,
IRemoteTransitionFinishedCallback finishedCallback) {
if (mergeTarget.equals(mToken) && mRecentsSession.merge(info, t)) {
try {
finishedCallback.onTransitionFinished(null /* wct */, null /* sct */);
} catch (RemoteException e) {
Log.e(TAG, "Error merging transition.", e);
}
// commit taskAppeared after merge transition finished.
mRecentsSession.commitTasksAppearedIfNeeded();
} else {
t.close();
info.releaseAllSurfaces();
}
}
};
return new RemoteTransition(remote, appThread, "Recents");
}
/**
* Wrapper to hook up parts of recents animation to shell transition.
* TODO(b/177438007): Remove this once Launcher handles shell transitions directly.
*/
@VisibleForTesting
static class RecentsControllerWrap extends IRecentsAnimationController.Default {
private RecentsAnimationListener mListener = null;
private IRemoteTransitionFinishedCallback mFinishCB = null;
/**
* List of tasks that we are switching away from via this transition. Upon finish, these
* pausing tasks will become invisible.
* These need to be ordered since the order must be restored if there is no task-switch.
*/
private ArrayList<TaskState> mPausingTasks = null;
/**
* List of tasks that we are switching to. Upon finish, these will remain visible and
* on top.
*/
private ArrayList<TaskState> mOpeningTasks = null;
private WindowContainerToken mPipTask = null;
private WindowContainerToken mRecentsTask = null;
private int mRecentsTaskId = 0;
private TransitionInfo mInfo = null;
private boolean mOpeningSeparateHome = false;
private ArrayMap<SurfaceControl, SurfaceControl> mLeashMap = null;
private PictureInPictureSurfaceTransaction mPipTransaction = null;
private IBinder mTransition = null;
private boolean mKeyguardLocked = false;
private RemoteAnimationTarget[] mAppearedTargets;
private boolean mWillFinishToHome = false;
/** The animation is idle, waiting for the user to choose a task to switch to. */
private static final int STATE_NORMAL = 0;
/** The user chose a new task to switch to and the animation is animating to it. */
private static final int STATE_NEW_TASK = 1;
/** The latest state that the recents animation is operating in. */
private int mState = STATE_NORMAL;
void start(RecentsAnimationListener listener,
IBinder transition, TransitionInfo info, SurfaceControl.Transaction t,
IRemoteTransitionFinishedCallback finishedCallback) {
if (mInfo != null) {
throw new IllegalStateException("Trying to run a new recents animation while"
+ " recents is already active.");
}
mListener = listener;
mInfo = info;
mFinishCB = finishedCallback;
mPausingTasks = new ArrayList<>();
mOpeningTasks = new ArrayList<>();
mPipTask = null;
mRecentsTask = null;
mRecentsTaskId = -1;
mLeashMap = new ArrayMap<>();
mTransition = transition;
mKeyguardLocked = (info.getFlags() & TRANSIT_FLAG_KEYGUARD_LOCKED) != 0;
mState = STATE_NORMAL;
final ArrayList<RemoteAnimationTarget> apps = new ArrayList<>();
final ArrayList<RemoteAnimationTarget> wallpapers = new ArrayList<>();
TransitionUtil.LeafTaskFilter leafTaskFilter = new TransitionUtil.LeafTaskFilter();
// About layering: we divide up the "layer space" into 3 regions (each the size of
// the change count). This lets us categorize things into above/below/between
// while maintaining their relative ordering.
for (int i = 0; i < info.getChanges().size(); ++i) {
final TransitionInfo.Change change = info.getChanges().get(i);
final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
if (TransitionUtil.isWallpaper(change)) {
final RemoteAnimationTarget target = TransitionUtil.newTarget(change,
// wallpapers go into the "below" layer space
info.getChanges().size() - i, info, t, mLeashMap);
wallpapers.add(target);
// Make all the wallpapers opaque since we want them visible from the start
t.setAlpha(target.leash, 1);
} else if (leafTaskFilter.test(change)) {
// start by putting everything into the "below" layer space.
final RemoteAnimationTarget target = TransitionUtil.newTarget(change,
info.getChanges().size() - i, info, t, mLeashMap);
apps.add(target);
if (TransitionUtil.isClosingType(change.getMode())) {
// raise closing (pausing) task to "above" layer so it isn't covered
t.setLayer(target.leash, info.getChanges().size() * 3 - i);
mPausingTasks.add(new TaskState(change, target.leash));
if (taskInfo.pictureInPictureParams != null
&& taskInfo.pictureInPictureParams.isAutoEnterEnabled()) {
mPipTask = taskInfo.token;
}
} else if (taskInfo != null
&& taskInfo.topActivityType == ACTIVITY_TYPE_RECENTS) {
// There's a 3p launcher, so make sure recents goes above that.
t.setLayer(target.leash, info.getChanges().size() * 3 - i);
mRecentsTask = taskInfo.token;
mRecentsTaskId = taskInfo.taskId;
} else if (taskInfo != null && taskInfo.topActivityType == ACTIVITY_TYPE_HOME) {
mRecentsTask = taskInfo.token;
mRecentsTaskId = taskInfo.taskId;
} else if (TransitionUtil.isOpeningType(change.getMode())) {
mOpeningTasks.add(new TaskState(change, target.leash));
}
}
}
t.apply();
mListener.onAnimationStart(new RecentsAnimationControllerCompat(this),
apps.toArray(new RemoteAnimationTarget[apps.size()]),
wallpapers.toArray(new RemoteAnimationTarget[wallpapers.size()]),
new Rect(0, 0, 0, 0), new Rect());
}
@SuppressLint("NewApi")
boolean merge(TransitionInfo info, SurfaceControl.Transaction t) {
if (info.getType() == TRANSIT_SLEEP) {
// A sleep event means we need to stop animations immediately, so cancel here.
mListener.onAnimationCanceled(new HashMap<>());
finish(mWillFinishToHome, false /* userLeaveHint */);
return false;
}
ArrayList<TransitionInfo.Change> openingTasks = null;
ArrayList<TransitionInfo.Change> closingTasks = null;
mAppearedTargets = null;
mOpeningSeparateHome = false;
TransitionInfo.Change recentsOpening = null;
boolean foundRecentsClosing = false;
boolean hasChangingApp = false;
final TransitionUtil.LeafTaskFilter leafTaskFilter =
new TransitionUtil.LeafTaskFilter();
for (int i = 0; i < info.getChanges().size(); ++i) {
final TransitionInfo.Change change = info.getChanges().get(i);
final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
final boolean isLeafTask = leafTaskFilter.test(change);
if (TransitionUtil.isOpeningType(change.getMode())) {
if (mRecentsTask.equals(change.getContainer())) {
recentsOpening = change;
} else if (isLeafTask) {
if (taskInfo.topActivityType == ACTIVITY_TYPE_HOME) {
// This is usually a 3p launcher
mOpeningSeparateHome = true;
}
if (openingTasks == null) {
openingTasks = new ArrayList<>();
}
openingTasks.add(change);
}
} else if (TransitionUtil.isClosingType(change.getMode())) {
if (mRecentsTask.equals(change.getContainer())) {
foundRecentsClosing = true;
} else if (isLeafTask) {
if (closingTasks == null) {
closingTasks = new ArrayList<>();
}
closingTasks.add(change);
}
} else if (change.getMode() == TRANSIT_CHANGE) {
// Finish recents animation if the display is changed, so the default
// transition handler can play the animation such as rotation effect.
if (change.hasFlags(TransitionInfo.FLAG_IS_DISPLAY)) {
mListener.onSwitchToScreenshot(() -> finish(false /* toHome */,
false /* userLeaveHint */));
return false;
}
hasChangingApp = true;
}
}
if (hasChangingApp && foundRecentsClosing) {
// This happens when a visible app is expanding (usually PiP). In this case,
// that transition probably has a special-purpose animation, so finish recents
// now and let it do its animation (since recents is going to be occluded).
if (!mListener.onSwitchToScreenshot(
() -> finish(true /* toHome */, false /* userLeaveHint */))) {
Log.w(TAG, "Recents callback doesn't support support switching to screenshot"
+ ", there might be a flicker.");
finish(true /* toHome */, false /* userLeaveHint */);
}
return false;
}
if (recentsOpening != null) {
// the recents task re-appeared. This happens if the user gestures before the
// task-switch (NEW_TASK) animation finishes.
if (mState == STATE_NORMAL) {
Log.e(TAG, "Returning to recents while recents is already idle.");
}
if (closingTasks == null || closingTasks.size() == 0) {
Log.e(TAG, "Returning to recents without closing any opening tasks.");
}
// Setup may hide it initially since it doesn't know that overview was still active.
t.show(recentsOpening.getLeash());
t.setAlpha(recentsOpening.getLeash(), 1.f);
mState = STATE_NORMAL;
}
boolean didMergeThings = false;
if (closingTasks != null) {
// Cancelling a task-switch. Move the tasks back to mPausing from mOpening
for (int i = 0; i < closingTasks.size(); ++i) {
final TransitionInfo.Change change = closingTasks.get(i);
int openingIdx = TaskState.indexOf(mOpeningTasks, change);
if (openingIdx < 0) {
Log.e(TAG, "Back to existing recents animation from an unrecognized "
+ "task: " + change.getTaskInfo().taskId);
continue;
}
mPausingTasks.add(mOpeningTasks.remove(openingIdx));
didMergeThings = true;
}
}
if (openingTasks != null && openingTasks.size() > 0) {
// Switching to some new tasks, add to mOpening and remove from mPausing. Also,
// enter NEW_TASK state since this will start the switch-to animation.
final int layer = mInfo.getChanges().size() * 3;
final RemoteAnimationTarget[] targets =
new RemoteAnimationTarget[openingTasks.size()];
for (int i = 0; i < openingTasks.size(); ++i) {
final TransitionInfo.Change change = openingTasks.get(i);
int pausingIdx = TaskState.indexOf(mPausingTasks, change);
if (pausingIdx >= 0) {
// Something is showing/opening a previously-pausing app.
targets[i] = TransitionUtil.newTarget(change, layer,
mPausingTasks.get(pausingIdx).mLeash);
mOpeningTasks.add(mPausingTasks.remove(pausingIdx));
// Setup hides opening tasks initially, so make it visible again (since we
// are already showing it).
t.show(change.getLeash());
t.setAlpha(change.getLeash(), 1.f);
} else {
// We are receiving new opening tasks, so convert to onTasksAppeared.
targets[i] = TransitionUtil.newTarget(change, layer, info, t, mLeashMap);
// reparent into the original `mInfo` since that's where we are animating.
final int rootIdx = TransitionUtil.rootIndexFor(change, mInfo);
t.reparent(targets[i].leash, mInfo.getRoot(rootIdx).getLeash());
t.setLayer(targets[i].leash, layer);
mOpeningTasks.add(new TaskState(change, targets[i].leash));
}
}
didMergeThings = true;
mState = STATE_NEW_TASK;
mAppearedTargets = targets;
}
if (!didMergeThings) {
// Didn't recognize anything in incoming transition so don't merge it.
Log.w(TAG, "Don't know how to merge this transition.");
return false;
}
t.apply();
// not using the incoming anim-only surfaces
info.releaseAnimSurfaces();
return true;
}
private void commitTasksAppearedIfNeeded() {
if (mAppearedTargets != null) {
mListener.onTasksAppeared(mAppearedTargets);
mAppearedTargets = null;
}
}
@Override public TaskSnapshot screenshotTask(int taskId) {
try {
return ActivityTaskManager.getService().takeTaskSnapshot(taskId,
true /* updateCache */);
} catch (RemoteException e) {
Log.e(TAG, "Failed to screenshot task", e);
}
return null;
}
@Override public void setInputConsumerEnabled(boolean enabled) {
if (!enabled) return;
// transient launches don't receive focus automatically. Since we are taking over
// the gesture now, take focus explicitly.
// This also moves recents back to top if the user gestured before a switch
// animation finished.
try {
ActivityTaskManager.getService().setFocusedTask(mRecentsTaskId);
} catch (RemoteException e) {
Log.e(TAG, "Failed to set focused task", e);
}
}
@Override public void setAnimationTargetsBehindSystemBars(boolean behindSystemBars) {
}
@Override public void setFinishTaskTransaction(int taskId,
PictureInPictureSurfaceTransaction finishTransaction, SurfaceControl overlay) {
mPipTransaction = finishTransaction;
}
@Override
@SuppressLint("NewApi")
public void finish(boolean toHome, boolean sendUserLeaveHint) {
if (mFinishCB == null) {
Log.e(TAG, "Duplicate call to finish", new RuntimeException());
return;
}
final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
final WindowContainerTransaction wct = new WindowContainerTransaction();
if (mKeyguardLocked && mRecentsTask != null) {
if (toHome) wct.reorder(mRecentsTask, true /* toTop */);
else wct.restoreTransientOrder(mRecentsTask);
}
if (!toHome && !mWillFinishToHome && mPausingTasks != null && mState == STATE_NORMAL) {
// The gesture is returning to the pausing-task(s) rather than continuing with
// recents, so end the transition by moving the app back to the top (and also
// re-showing it's task).
for (int i = mPausingTasks.size() - 1; i >= 0; --i) {
// reverse order so that index 0 ends up on top
wct.reorder(mPausingTasks.get(i).mToken, true /* onTop */);
t.show(mPausingTasks.get(i).mTaskSurface);
}
if (!mKeyguardLocked && mRecentsTask != null) {
wct.restoreTransientOrder(mRecentsTask);
}
} else if (toHome && mOpeningSeparateHome && mPausingTasks != null) {
// Special situation where 3p launcher was changed during recents (this happens
// during tapltests...). Here we get both "return to home" AND "home opening".
// This is basically going home, but we have to restore the recents and home order.
for (int i = 0; i < mOpeningTasks.size(); ++i) {
final TaskState state = mOpeningTasks.get(i);
if (state.mTaskInfo.topActivityType == ACTIVITY_TYPE_HOME) {
// Make sure it is on top.
wct.reorder(state.mToken, true /* onTop */);
}
t.show(state.mTaskSurface);
}
for (int i = mPausingTasks.size() - 1; i >= 0; --i) {
t.hide(mPausingTasks.get(i).mTaskSurface);
}
if (!mKeyguardLocked && mRecentsTask != null) {
wct.restoreTransientOrder(mRecentsTask);
}
} else {
// The general case: committing to recents, going home, or switching tasks.
for (int i = 0; i < mOpeningTasks.size(); ++i) {
t.show(mOpeningTasks.get(i).mTaskSurface);
}
for (int i = 0; i < mPausingTasks.size(); ++i) {
if (!sendUserLeaveHint) {
// This means recents is not *actually* finishing, so of course we gotta
// do special stuff in WMCore to accommodate.
wct.setDoNotPip(mPausingTasks.get(i).mToken);
}
// Since we will reparent out of the leashes, pre-emptively hide the child
// surface to match the leash. Otherwise, there will be a flicker before the
// visibility gets committed in Core when using split-screen (in splitscreen,
// the leaf-tasks are not "independent" so aren't hidden by normal setup).
t.hide(mPausingTasks.get(i).mTaskSurface);
}
if (mPipTask != null && mPipTransaction != null && sendUserLeaveHint) {
t.show(mInfo.getChange(mPipTask).getLeash());
PictureInPictureSurfaceTransaction.apply(mPipTransaction,
mInfo.getChange(mPipTask).getLeash(), t);
mPipTask = null;
mPipTransaction = null;
}
}
try {
mFinishCB.onTransitionFinished(wct.isEmpty() ? null : wct, t);
} catch (RemoteException e) {
Log.e(TAG, "Failed to call animation finish callback", e);
t.apply();
}
// Only release the non-local created surface references. The animator is responsible
// for releasing the leashes created by local.
mInfo.releaseAllSurfaces();
// Reset all members.
mListener = null;
mFinishCB = null;
mPausingTasks = null;
mOpeningTasks = null;
mAppearedTargets = null;
mInfo = null;
mOpeningSeparateHome = false;
mLeashMap = null;
mTransition = null;
mState = STATE_NORMAL;
}
@Override public void setDeferCancelUntilNextTransition(boolean defer, boolean screenshot) {
}
@Override public void cleanupScreenshot() {
}
@Override public void setWillFinishToHome(boolean willFinishToHome) {
mWillFinishToHome = willFinishToHome;
}
/**
* @see IRecentsAnimationController#removeTask
*/
@Override public boolean removeTask(int taskId) {
return false;
}
/**
* @see IRecentsAnimationController#detachNavigationBarFromApp
*/
@Override public void detachNavigationBarFromApp(boolean moveHomeToTop) {
try {
ActivityTaskManager.getService().detachNavigationBarFromApp(mTransition);
} catch (RemoteException e) {
Log.e(TAG, "Failed to detach the navigation bar from app", e);
}
}
/**
* @see IRecentsAnimationController#animateNavigationBarToApp(long)
*/
@Override public void animateNavigationBarToApp(long duration) {
}
}
/** Utility class to track the state of a task as-seen by recents. */
private static class TaskState {
WindowContainerToken mToken;
ActivityManager.RunningTaskInfo mTaskInfo;
/** The surface/leash of the task provided by Core. */
SurfaceControl mTaskSurface;
/** The (local) animation-leash created for this task. */
SurfaceControl mLeash;
TaskState(TransitionInfo.Change change, SurfaceControl leash) {
mToken = change.getContainer();
mTaskInfo = change.getTaskInfo();
mTaskSurface = change.getLeash();
mLeash = leash;
}
static int indexOf(ArrayList<TaskState> list, TransitionInfo.Change change) {
for (int i = list.size() - 1; i >= 0; --i) {
if (list.get(i).mToken.equals(change.getContainer())) {
return i;
}
}
return -1;
}
public String toString() {
return "" + mToken + " : " + mLeash;
}
}
}

View File

@@ -1,192 +0,0 @@
/*
* Copyright (C) 2019 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.tracing;
import android.os.Trace;
import android.util.Log;
import android.view.Choreographer;
import com.android.internal.util.TraceBuffer;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Queue;
import java.util.function.Consumer;
/**
* A proto tracer implementation that can be updated directly (upon state change), or on the next
* scheduled frame.
*
* @param <P> The class type of the proto provider
* @param <S> The proto class type of the encapsulating proto
* @param <T> The proto class type of the individual proto entries in the buffer
* @param <R> The proto class type of the entry root proto in the buffer
*/
public class FrameProtoTracer<P, S extends P, T extends P, R>
implements Choreographer.FrameCallback {
private static final String TAG = "FrameProtoTracer";
private static final int BUFFER_CAPACITY = 1024 * 1024;
private final Object mLock = new Object();
private final TraceBuffer<P, S, T> mBuffer;
private final File mTraceFile;
private final ProtoTraceParams<P, S, T, R> mParams;
private Choreographer mChoreographer;
private final Queue<T> mPool = new ArrayDeque<>();
private final ArrayList<ProtoTraceable<R>> mTraceables = new ArrayList<>();
private final ArrayList<ProtoTraceable<R>> mTmpTraceables = new ArrayList<>();
private volatile boolean mEnabled;
private boolean mFrameScheduled;
private final TraceBuffer.ProtoProvider<P, S, T> mProvider =
new TraceBuffer.ProtoProvider<P, S, T>() {
@Override
public int getItemSize(P proto) {
return mParams.getProtoSize(proto);
}
@Override
public byte[] getBytes(P proto) {
return mParams.getProtoBytes(proto);
}
@Override
public void write(S encapsulatingProto, Queue<T> buffer, OutputStream os)
throws IOException {
os.write(mParams.serializeEncapsulatingProto(encapsulatingProto, buffer));
}
};
public interface ProtoTraceParams<P, S, T, R> {
File getTraceFile();
S getEncapsulatingTraceProto();
T updateBufferProto(T reuseObj, ArrayList<ProtoTraceable<R>> traceables);
byte[] serializeEncapsulatingProto(S encapsulatingProto, Queue<T> buffer);
byte[] getProtoBytes(P proto);
int getProtoSize(P proto);
}
public FrameProtoTracer(ProtoTraceParams<P, S, T, R> params) {
mParams = params;
mBuffer = new TraceBuffer<>(BUFFER_CAPACITY, mProvider, new Consumer<T>() {
@Override
public void accept(T t) {
onProtoDequeued(t);
}
});
mTraceFile = params.getTraceFile();
}
public void start() {
synchronized (mLock) {
if (mEnabled) {
return;
}
mBuffer.resetBuffer();
mEnabled = true;
}
logState();
}
public void stop() {
synchronized (mLock) {
if (!mEnabled) {
return;
}
mEnabled = false;
}
writeToFile();
}
public boolean isEnabled() {
return mEnabled;
}
public void add(ProtoTraceable<R> traceable) {
synchronized (mLock) {
mTraceables.add(traceable);
}
}
public void remove(ProtoTraceable<R> traceable) {
synchronized (mLock) {
mTraceables.remove(traceable);
}
}
public void scheduleFrameUpdate() {
if (!mEnabled || mFrameScheduled) {
return;
}
// Schedule an update on the next frame
if (mChoreographer == null) {
mChoreographer = Choreographer.getMainThreadInstance();
}
mChoreographer.postFrameCallback(this);
mFrameScheduled = true;
}
public void update() {
if (!mEnabled) {
return;
}
logState();
}
public float getBufferUsagePct() {
return (float) mBuffer.getBufferSize() / BUFFER_CAPACITY;
}
@Override
public void doFrame(long frameTimeNanos) {
logState();
}
private void onProtoDequeued(T proto) {
mPool.add(proto);
}
private void logState() {
synchronized (mLock) {
mTmpTraceables.addAll(mTraceables);
}
mBuffer.add(mParams.updateBufferProto(mPool.poll(), mTmpTraceables));
mTmpTraceables.clear();
mFrameScheduled = false;
}
private void writeToFile() {
try {
Trace.beginSection("ProtoTracer.writeToFile");
mBuffer.writeTraceToFile(mTraceFile, mParams.getEncapsulatingTraceProto());
} catch (IOException e) {
Log.e(TAG, "Unable to write buffer to file", e);
} finally {
Trace.endSection();
}
}
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright (C) 2017 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.tracing;
/**
* @see FrameProtoTracer
*/
public interface ProtoTraceable<T> {
/**
* NOTE: Implementations should update all fields in this proto.
*/
void writeToProto(T proto);
}

View File

@@ -123,7 +123,6 @@ import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.statusbar.window.StatusBarWindowController;
import com.android.systemui.telephony.TelephonyListenerManager;
import com.android.systemui.tracing.ProtoTracer;
import com.android.systemui.tuner.TunablePadding.TunablePaddingService;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.util.DeviceConfigProxy;
@@ -335,7 +334,6 @@ public class Dependency {
@Inject Lazy<IWallpaperManager> mWallpaperManager;
@Inject Lazy<CommandQueue> mCommandQueue;
@Inject Lazy<RecordingController> mRecordingController;
@Inject Lazy<ProtoTracer> mProtoTracer;
@Inject Lazy<MediaOutputDialogFactory> mMediaOutputDialogFactory;
@Inject Lazy<DeviceConfigProxy> mDeviceConfigProxy;
@Inject Lazy<TelephonyListenerManager> mTelephonyListenerManager;
@@ -528,7 +526,6 @@ public class Dependency {
mProviders.put(DozeParameters.class, mDozeParameters::get);
mProviders.put(IWallpaperManager.class, mWallpaperManager::get);
mProviders.put(CommandQueue.class, mCommandQueue::get);
mProviders.put(ProtoTracer.class, mProtoTracer::get);
mProviders.put(DeviceConfigProxy.class, mDeviceConfigProxy::get);
mProviders.put(TelephonyListenerManager.class, mTelephonyListenerManager::get);

View File

@@ -88,11 +88,7 @@ import com.android.systemui.shared.system.QuickStepContract;
import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.TaskStackChangeListeners;
import com.android.systemui.shared.tracing.ProtoTraceable;
import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.tracing.ProtoTracer;
import com.android.systemui.tracing.nano.EdgeBackGestureHandlerProto;
import com.android.systemui.tracing.nano.SystemUiTraceProto;
import com.android.systemui.util.Assert;
import com.android.wm.shell.back.BackAnimation;
import com.android.wm.shell.desktopmode.DesktopMode;
@@ -115,8 +111,7 @@ import javax.inject.Provider;
/**
* Utility class to handle edge swipes for back gesture
*/
public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBackPlugin>,
ProtoTraceable<SystemUiTraceProto> {
public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBackPlugin> {
private static final String TAG = "EdgeBackGestureHandler";
private static final int MAX_LONG_PRESS_TIMEOUT = SystemProperties.getInt(
@@ -192,7 +187,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
private Consumer<Boolean> mButtonForcedVisibleCallback;
private final PluginManager mPluginManager;
private final ProtoTracer mProtoTracer;
private final NavigationModeController mNavigationModeController;
private final BackPanelController.Factory mBackPanelControllerFactory;
private final ViewConfiguration mViewConfiguration;
@@ -402,7 +396,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
@Main Handler handler,
@Background Executor backgroundExecutor,
UserTracker userTracker,
ProtoTracer protoTracer,
NavigationModeController navigationModeController,
BackPanelController.Factory backPanelControllerFactory,
ViewConfiguration viewConfiguration,
@@ -425,7 +418,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
mOverviewProxyService = overviewProxyService;
mSysUiState = sysUiState;
mPluginManager = pluginManager;
mProtoTracer = protoTracer;
mNavigationModeController = navigationModeController;
mBackPanelControllerFactory = backPanelControllerFactory;
mViewConfiguration = viewConfiguration;
@@ -557,7 +549,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
*/
public void onNavBarAttached() {
mIsAttached = true;
mProtoTracer.add(this);
mOverviewProxyService.addCallback(mQuickSwitchListener);
mSysUiState.addCallback(mSysUiStateCallback);
if (mIsTrackpadGestureFeaturesEnabled) {
@@ -576,7 +567,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
*/
public void onNavBarDetached() {
mIsAttached = false;
mProtoTracer.remove(this);
mOverviewProxyService.removeCallback(mQuickSwitchListener);
mSysUiState.removeCallback(mSysUiStateCallback);
mInputManager.unregisterInputDeviceListener(mInputDeviceListener);
@@ -1135,8 +1125,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
dispatchToBackAnimation(ev);
}
}
mProtoTracer.scheduleFrameUpdate();
}
private boolean isButtonPressFromTrackpad(MotionEvent ev) {
@@ -1285,14 +1273,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
return topActivity != null && mGestureBlockingActivities.contains(topActivity);
}
@Override
public void writeToProto(SystemUiTraceProto proto) {
if (proto.edgeBackGestureHandler == null) {
proto.edgeBackGestureHandler = new EdgeBackGestureHandlerProto();
}
proto.edgeBackGestureHandler.allowGesture = mAllowGesture;
}
public void setBackAnimation(BackAnimation backAnimation) {
mBackAnimation = backAnimation;
updateBackAnimationThresholds();
@@ -1319,7 +1299,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
private final Handler mHandler;
private final Executor mBackgroundExecutor;
private final UserTracker mUserTracker;
private final ProtoTracer mProtoTracer;
private final NavigationModeController mNavigationModeController;
private final BackPanelController.Factory mBackPanelControllerFactory;
private final ViewConfiguration mViewConfiguration;
@@ -1343,7 +1322,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
@Main Handler handler,
@Background Executor backgroundExecutor,
UserTracker userTracker,
ProtoTracer protoTracer,
NavigationModeController navigationModeController,
BackPanelController.Factory backPanelControllerFactory,
ViewConfiguration viewConfiguration,
@@ -1365,7 +1343,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
mHandler = handler;
mBackgroundExecutor = backgroundExecutor;
mUserTracker = userTracker;
mProtoTracer = protoTracer;
mNavigationModeController = navigationModeController;
mBackPanelControllerFactory = backPanelControllerFactory;
mViewConfiguration = viewConfiguration;
@@ -1392,7 +1369,6 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
mHandler,
mBackgroundExecutor,
mUserTracker,
mProtoTracer,
mNavigationModeController,
mBackPanelControllerFactory,
mViewConfiguration,

View File

@@ -25,11 +25,9 @@ import static android.view.MotionEvent.ACTION_UP;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON;
import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUPPORTS_WINDOW_CORNERS;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNFOLD_ANIMATION_FORWARDER;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER;
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_AWAKE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DOZING;
@@ -173,8 +171,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
private boolean mInputFocusTransferStarted;
private float mInputFocusTransferStartY;
private long mInputFocusTransferStartMillis;
private float mWindowCornerRadius;
private boolean mSupportsRoundedCornersOnWindows;
private int mNavBarMode = NAV_BAR_MODE_3BUTTON;
@VisibleForTesting
@@ -454,8 +450,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
Bundle params = new Bundle();
params.putBinder(KEY_EXTRA_SYSUI_PROXY, mSysUiProxy.asBinder());
params.putFloat(KEY_EXTRA_WINDOW_CORNER_RADIUS, mWindowCornerRadius);
params.putBoolean(KEY_EXTRA_SUPPORTS_WINDOW_CORNERS, mSupportsRoundedCornersOnWindows);
params.putBinder(KEY_EXTRA_UNLOCK_ANIMATION_CONTROLLER,
mSysuiUnlockAnimationController.asBinder());
mUnfoldTransitionProgressForwarder.ifPresent(
@@ -588,9 +582,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
com.android.internal.R.string.config_recentsComponentName));
mQuickStepIntent = new Intent(ACTION_QUICKSTEP)
.setPackage(mRecentsComponentName.getPackageName());
mWindowCornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(mContext);
mSupportsRoundedCornersOnWindows = ScreenDecorationsUtils
.supportsRoundedCornersOnWindows(mContext.getResources());
mSysUiState = sysUiState;
mSysUiState.addCallback(this::notifySystemUiStateFlags);
mUiEventLogger = uiEventLogger;
@@ -1084,8 +1075,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
pw.print(" mInputFocusTransferStarted="); pw.println(mInputFocusTransferStarted);
pw.print(" mInputFocusTransferStartY="); pw.println(mInputFocusTransferStartY);
pw.print(" mInputFocusTransferStartMillis="); pw.println(mInputFocusTransferStartMillis);
pw.print(" mWindowCornerRadius="); pw.println(mWindowCornerRadius);
pw.print(" mSupportsRoundedCornersOnWindows="); pw.println(mSupportsRoundedCornersOnWindows);
pw.print(" mActiveNavBarRegion="); pw.println(mActiveNavBarRegion);
pw.print(" mNavigationBarSurface="); pw.println(mNavigationBarSurface);
pw.print(" mNavBarMode="); pw.println(mNavBarMode);

View File

@@ -73,7 +73,6 @@ import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.statusbar.CommandQueue.Callbacks;
import com.android.systemui.statusbar.commandline.CommandRegistry;
import com.android.systemui.statusbar.policy.CallbackController;
import com.android.systemui.tracing.ProtoTracer;
import java.io.FileDescriptor;
import java.io.FileOutputStream;
@@ -190,7 +189,6 @@ public class CommandQueue extends IStatusBar.Stub implements
*/
private int mLastUpdatedImeDisplayId = INVALID_DISPLAY;
private final DisplayTracker mDisplayTracker;
private ProtoTracer mProtoTracer;
private final @Nullable CommandRegistry mRegistry;
private final @Nullable DumpHandler mDumpHandler;
@@ -504,18 +502,16 @@ public class CommandQueue extends IStatusBar.Stub implements
@VisibleForTesting
public CommandQueue(Context context, DisplayTracker displayTracker) {
this(context, displayTracker, null, null, null);
this(context, displayTracker, null, null);
}
public CommandQueue(
Context context,
DisplayTracker displayTracker,
ProtoTracer protoTracer,
CommandRegistry registry,
DumpHandler dumpHandler
) {
mDisplayTracker = displayTracker;
mProtoTracer = protoTracer;
mRegistry = registry;
mDumpHandler = dumpHandler;
mDisplayTracker.addDisplayChangeCallback(new DisplayTracker.Callback() {
@@ -1160,9 +1156,6 @@ public class CommandQueue extends IStatusBar.Stub implements
@Override
public void startTracing() {
synchronized (mLock) {
if (mProtoTracer != null) {
mProtoTracer.start();
}
mHandler.obtainMessage(MSG_TRACING_STATE_CHANGED, true).sendToTarget();
}
}
@@ -1170,9 +1163,6 @@ public class CommandQueue extends IStatusBar.Stub implements
@Override
public void stopTracing() {
synchronized (mLock) {
if (mProtoTracer != null) {
mProtoTracer.stop();
}
mHandler.obtainMessage(MSG_TRACING_STATE_CHANGED, false).sendToTarget();
}
}

View File

@@ -78,7 +78,6 @@ import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallLogger;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.RemoteInputUriController;
import com.android.systemui.statusbar.window.StatusBarWindowController;
import com.android.systemui.tracing.ProtoTracer;
import com.android.systemui.util.concurrency.DelayableExecutor;
import com.android.systemui.util.time.SystemClock;
@@ -195,11 +194,10 @@ public interface CentralSurfacesDependenciesModule {
static CommandQueue provideCommandQueue(
Context context,
DisplayTracker displayTracker,
ProtoTracer protoTracer,
CommandRegistry registry,
DumpHandler dumpHandler
) {
return new CommandQueue(context, displayTracker, protoTracer, registry, dumpHandler);
return new CommandQueue(context, displayTracker, registry, dumpHandler);
}
/**

View File

@@ -1,149 +0,0 @@
/*
* Copyright (C) 2019 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.tracing;
import static com.android.systemui.tracing.nano.SystemUiTraceFileProto.MAGIC_NUMBER_H;
import static com.android.systemui.tracing.nano.SystemUiTraceFileProto.MAGIC_NUMBER_L;
import android.content.Context;
import android.os.SystemClock;
import androidx.annotation.NonNull;
import com.android.systemui.Dumpable;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dump.DumpManager;
import com.android.systemui.shared.tracing.FrameProtoTracer;
import com.android.systemui.shared.tracing.FrameProtoTracer.ProtoTraceParams;
import com.android.systemui.shared.tracing.ProtoTraceable;
import com.android.systemui.tracing.nano.SystemUiTraceEntryProto;
import com.android.systemui.tracing.nano.SystemUiTraceFileProto;
import com.android.systemui.tracing.nano.SystemUiTraceProto;
import com.google.protobuf.nano.MessageNano;
import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Queue;
import javax.inject.Inject;
/**
* Controller for coordinating winscope proto tracing.
*/
@SysUISingleton
public class ProtoTracer implements
Dumpable,
ProtoTraceParams<
MessageNano,
SystemUiTraceFileProto,
SystemUiTraceEntryProto,
SystemUiTraceProto> {
private static final String TAG = "ProtoTracer";
private static final long MAGIC_NUMBER_VALUE = ((long) MAGIC_NUMBER_H << 32) | MAGIC_NUMBER_L;
private final Context mContext;
private final FrameProtoTracer<MessageNano, SystemUiTraceFileProto, SystemUiTraceEntryProto,
SystemUiTraceProto> mProtoTracer;
@Inject
public ProtoTracer(Context context, DumpManager dumpManager) {
mContext = context;
mProtoTracer = new FrameProtoTracer<>(this);
dumpManager.registerDumpable(this);
}
@Override
public File getTraceFile() {
return new File(mContext.getFilesDir(), "sysui_trace.pb");
}
@Override
public SystemUiTraceFileProto getEncapsulatingTraceProto() {
return new SystemUiTraceFileProto();
}
@Override
public SystemUiTraceEntryProto updateBufferProto(SystemUiTraceEntryProto reuseObj,
ArrayList<ProtoTraceable<SystemUiTraceProto>> traceables) {
SystemUiTraceEntryProto proto = reuseObj != null
? reuseObj
: new SystemUiTraceEntryProto();
proto.elapsedRealtimeNanos = SystemClock.elapsedRealtimeNanos();
proto.systemUi = proto.systemUi != null ? proto.systemUi : new SystemUiTraceProto();
for (ProtoTraceable t : traceables) {
t.writeToProto(proto.systemUi);
}
return proto;
}
@Override
public byte[] serializeEncapsulatingProto(SystemUiTraceFileProto encapsulatingProto,
Queue<SystemUiTraceEntryProto> buffer) {
encapsulatingProto.magicNumber = MAGIC_NUMBER_VALUE;
encapsulatingProto.entry = buffer.toArray(new SystemUiTraceEntryProto[0]);
return MessageNano.toByteArray(encapsulatingProto);
}
@Override
public byte[] getProtoBytes(MessageNano proto) {
return MessageNano.toByteArray(proto);
}
@Override
public int getProtoSize(MessageNano proto) {
return proto.getCachedSize();
}
public void start() {
mProtoTracer.start();
}
public void stop() {
mProtoTracer.stop();
}
public boolean isEnabled() {
return mProtoTracer.isEnabled();
}
public void add(ProtoTraceable<SystemUiTraceProto> traceable) {
mProtoTracer.add(traceable);
}
public void remove(ProtoTraceable<SystemUiTraceProto> traceable) {
mProtoTracer.remove(traceable);
}
public void scheduleFrameUpdate() {
mProtoTracer.scheduleFrameUpdate();
}
public void update() {
mProtoTracer.update();
}
@Override
public void dump(@NonNull PrintWriter pw, @NonNull String[] args) {
pw.println("ProtoTracer:");
pw.print(" "); pw.println("enabled: " + mProtoTracer.isEnabled());
pw.print(" "); pw.println("usagePct: " + mProtoTracer.getBufferUsagePct());
pw.print(" "); pw.println("file: " + getTraceFile());
}
}

View File

@@ -1,57 +0,0 @@
/*
* Copyright (C) 2019 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.
*/
syntax = "proto2";
package com.android.systemui.tracing;
option java_multiple_files = true;
message SystemUiTraceProto {
optional EdgeBackGestureHandlerProto edge_back_gesture_handler = 1;
}
message EdgeBackGestureHandlerProto {
optional bool allow_gesture = 1;
}
/* represents a file full of system ui trace entries.
Encoded, it should start with 0x9 0x53 0x59 0x53 0x55 0x49 0x54 0x52 0x43 (.SYSUITRC), such
that they can be easily identified. */
message SystemUiTraceFileProto {
/* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L
(this is needed because enums have to be 32 bits and there's no nice way to put 64bit
constants into .proto files. */
enum MagicNumber {
INVALID = 0;
MAGIC_NUMBER_L = 0x55535953; /* SYSU (little-endian ASCII) */
MAGIC_NUMBER_H = 0x43525449; /* ITRC (little-endian ASCII) */
}
optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */
repeated SystemUiTraceEntryProto entry = 2;
}
/* one system ui trace entry. */
message SystemUiTraceEntryProto {
/* required: elapsed realtime in nanos since boot of when this entry was logged */
optional fixed64 elapsed_realtime_nanos = 1;
optional SystemUiTraceProto system_ui = 3;
}

View File

@@ -51,15 +51,11 @@ import com.android.systemui.model.SysUiState;
import com.android.systemui.notetask.NoteTaskInitializer;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shared.tracing.ProtoTraceable;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.tracing.ProtoTracer;
import com.android.systemui.tracing.nano.SystemUiTraceProto;
import com.android.wm.shell.desktopmode.DesktopMode;
import com.android.wm.shell.desktopmode.DesktopModeTaskRepository;
import com.android.wm.shell.nano.WmShellTraceProto;
import com.android.wm.shell.onehanded.OneHanded;
import com.android.wm.shell.onehanded.OneHandedEventCallback;
import com.android.wm.shell.onehanded.OneHandedTransitionCallback;
@@ -94,8 +90,7 @@ import javax.inject.Inject;
@SysUISingleton
public final class WMShell implements
CoreStartable,
CommandQueue.Callbacks,
ProtoTraceable<SystemUiTraceProto> {
CommandQueue.Callbacks {
private static final String TAG = WMShell.class.getName();
private static final int INVALID_SYSUI_STATE_MASK =
SYSUI_STATE_DIALOG_SHOWING
@@ -122,7 +117,6 @@ public final class WMShell implements
private final ScreenLifecycle mScreenLifecycle;
private final SysUiState mSysUiState;
private final WakefulnessLifecycle mWakefulnessLifecycle;
private final ProtoTracer mProtoTracer;
private final UserTracker mUserTracker;
private final DisplayTracker mDisplayTracker;
private final NoteTaskInitializer mNoteTaskInitializer;
@@ -184,7 +178,6 @@ public final class WMShell implements
KeyguardUpdateMonitor keyguardUpdateMonitor,
ScreenLifecycle screenLifecycle,
SysUiState sysUiState,
ProtoTracer protoTracer,
WakefulnessLifecycle wakefulnessLifecycle,
UserTracker userTracker,
DisplayTracker displayTracker,
@@ -203,7 +196,6 @@ public final class WMShell implements
mOneHandedOptional = oneHandedOptional;
mDesktopModeOptional = desktopMode;
mWakefulnessLifecycle = wakefulnessLifecycle;
mProtoTracer = protoTracer;
mUserTracker = userTracker;
mDisplayTracker = displayTracker;
mNoteTaskInitializer = noteTaskInitializer;
@@ -223,7 +215,6 @@ public final class WMShell implements
// Subscribe to user changes
mUserTracker.addCallback(mUserChangedCallback, mContext.getMainExecutor());
mProtoTracer.add(this);
mCommandQueue.addCallback(this);
mPipOptional.ifPresent(this::initPip);
mSplitScreenOptional.ifPresent(this::initSplitScreen);
@@ -360,12 +351,6 @@ public final class WMShell implements
}, mSysUiMainExecutor);
}
@Override
public void writeToProto(SystemUiTraceProto proto) {
// Dump to WMShell proto here
// TODO: Figure out how we want to synchronize while dumping to proto
}
@Override
public void dump(PrintWriter pw, String[] args) {
// Handle commands if provided

View File

@@ -34,7 +34,6 @@ import com.android.systemui.settings.UserTracker;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.tracing.ProtoTracer;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.desktopmode.DesktopMode;
import com.android.wm.shell.desktopmode.DesktopModeTaskRepository;
@@ -76,7 +75,6 @@ public class WMShellTest extends SysuiTestCase {
@Mock SplitScreen mSplitScreen;
@Mock OneHanded mOneHanded;
@Mock WakefulnessLifecycle mWakefulnessLifecycle;
@Mock ProtoTracer mProtoTracer;
@Mock UserTracker mUserTracker;
@Mock ShellExecutor mSysUiMainExecutor;
@Mock NoteTaskInitializer mNoteTaskInitializer;
@@ -99,7 +97,6 @@ public class WMShellTest extends SysuiTestCase {
mKeyguardUpdateMonitor,
mScreenLifecycle,
mSysUiState,
mProtoTracer,
mWakefulnessLifecycle,
mUserTracker,
displayTracker,