Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6401c02 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Revert "4/ Update SysUI shared lib for Recents transition"

This reverts commit 9f6ba8df.

Breaks presubmits
parent bb8a385f
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -29,9 +29,4 @@ interface ISystemUiProxy {
     */
    GraphicBufferCompat screenshot(in Rect sourceCrop, int width, int height, int minLayer,
            int maxLayer, boolean useIdentityTransform, int rotation);

    /**
     * Called when the overview service has started the recents animation.
     */
    void onRecentsAnimationStarted();
}
+5 −24
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.app.AppGlobals;
import android.app.IAssistDataReceiver;
import android.app.WindowConfiguration.ActivityType;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -49,10 +48,7 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.util.IconDrawableFactory;
import android.util.Log;
import android.view.IRecentsAnimationController;
import android.view.IRecentsAnimationRunner;

import android.view.RemoteAnimationTarget;
import com.android.systemui.shared.recents.model.Task;
import com.android.systemui.shared.recents.model.Task.TaskKey;
import com.android.systemui.shared.recents.model.ThumbnailData;
@@ -247,9 +243,10 @@ public class ActivityManagerWrapper {
    /**
     * Starts the recents activity. The caller should manage the thread on which this is called.
     */
    public void startRecentsActivity(Intent intent, AssistDataReceiver assistDataReceiver,
            RecentsAnimationListener animationHandler, Consumer<Boolean> resultCallback,
    public void startRecentsActivity(AssistDataReceiverCompat assistDataReceiver, Bundle options,
            ActivityOptions opts, int userId, Consumer<Boolean> resultCallback,
            Handler resultCallbackHandler) {
        Bundle activityOptions = opts != null ? opts.toBundle() : null;
        try {
            IAssistDataReceiver receiver = null;
            if (assistDataReceiver != null) {
@@ -262,24 +259,8 @@ public class ActivityManagerWrapper {
                    }
                };
            }
            IRecentsAnimationRunner runner = null;
            if (animationHandler != null) {
                runner = new IRecentsAnimationRunner.Stub() {
                    public void onAnimationStart(IRecentsAnimationController controller,
                            RemoteAnimationTarget[] apps) {
                        final RecentsAnimationControllerCompat controllerCompat =
                                new RecentsAnimationControllerCompat(controller);
                        final RemoteAnimationTargetCompat[] appsCompat =
                                RemoteAnimationTargetCompat.wrap(apps);
                        animationHandler.onAnimationStart(controllerCompat, appsCompat);
                    }

                    public void onAnimationCanceled() {
                        animationHandler.onAnimationCanceled();
                    }
                };
            }
            ActivityManager.getService().startRecentsActivity(intent, receiver, runner);
            ActivityManager.getService().startRecentsActivity(receiver, options, activityOptions,
                    userId);
            if (resultCallback != null) {
                resultCallbackHandler.post(new Runnable() {
                    @Override
+3 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import android.os.Bundle;
/**
 * Abstract class for assist data receivers.
 */
public abstract class AssistDataReceiver {
    public void onHandleAssistData(Bundle resultData) {}
    public void onHandleAssistScreenshot(Bitmap screenshot) {}
public abstract class AssistDataReceiverCompat {
    public abstract void onHandleAssistData(Bundle resultData);
    public abstract void onHandleAssistScreenshot(Bitmap screenshot);
}
+0 −61
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 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.app.ActivityManager.TaskSnapshot;
import android.os.RemoteException;
import android.util.Log;
import android.view.IRecentsAnimationController;

import com.android.systemui.shared.recents.model.ThumbnailData;

public class RecentsAnimationControllerCompat {

    private static final String TAG = RecentsAnimationControllerCompat.class.getSimpleName();

    private IRecentsAnimationController mAnimationController;

    public RecentsAnimationControllerCompat(IRecentsAnimationController animationController) {
        mAnimationController = animationController;
    }

    public ThumbnailData screenshotTask(int taskId) {
        try {
            TaskSnapshot snapshot = mAnimationController.screenshotTask(taskId);
            return snapshot != null ? new ThumbnailData(snapshot) : new ThumbnailData();
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to screenshot task", e);
            return new ThumbnailData();
        }
    }

    public void setInputConsumerEnabled(boolean enabled) {
        try {
            mAnimationController.setInputConsumerEnabled(enabled);
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to set input consumer enabled state", e);
        }
    }

    public void finish(boolean toHome) {
        try {
            mAnimationController.finish(toHome);
        } catch (RemoteException e) {
            Log.e(TAG, "Failed to finish recents animation", e);
        }
    }
}
 No newline at end of file
+0 −31
Original line number Diff line number Diff line
/*
 * 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.system;

public interface RecentsAnimationListener {

    /**
     * Called when the animation into Recents can start. This call is made on the binder thread.
     */
    void onAnimationStart(RecentsAnimationControllerCompat controller,
            RemoteAnimationTargetCompat[] apps);

    /**
     * Called when the animation into Recents was canceled. This call is made on the binder thread.
     */
    void onAnimationCanceled();
}
 No newline at end of file
Loading