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

Commit a9b4133c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Removing some unsed compat APIs"

parents 9ce352d0 056b80da
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.systemui.shared.recents;

import android.graphics.Rect;
import com.android.systemui.shared.system.GraphicBufferCompat;

/**
 * Temporary callbacks into SystemUI.
@@ -26,9 +25,10 @@ interface ISystemUiProxy {

    /**
     * Proxies SurfaceControl.screenshotToBuffer().
     * @Removed
     * GraphicBufferCompat screenshot(in Rect sourceCrop, int width, int height, int minLayer,
     *             int maxLayer, boolean useIdentityTransform, int rotation) = 0;
     */
    GraphicBufferCompat screenshot(in Rect sourceCrop, int width, int height, int minLayer,
            int maxLayer, boolean useIdentityTransform, int rotation) = 0;

    /**
     * Begins screen pinning on the provided {@param taskId}.
+0 −19
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;

parcelable GraphicBufferCompat;
 No newline at end of file
+0 −64
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;

import android.graphics.Bitmap;
import android.graphics.GraphicBuffer;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * Wraps the internal graphic buffer.
 */
public class GraphicBufferCompat implements Parcelable {

    private GraphicBuffer mBuffer;

    public GraphicBufferCompat(GraphicBuffer buffer) {
        mBuffer = buffer;
    }

    public GraphicBufferCompat(Parcel in) {
        mBuffer = GraphicBuffer.CREATOR.createFromParcel(in);
    }

    public Bitmap toBitmap() {
        return mBuffer != null
                ? Bitmap.createHardwareBitmap(mBuffer)
                : null;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        mBuffer.writeToParcel(dest, flags);
    }

    public static final Parcelable.Creator<GraphicBufferCompat> CREATOR
            = new Parcelable.Creator<GraphicBufferCompat>() {
        public GraphicBufferCompat createFromParcel(Parcel in) {
            return new GraphicBufferCompat(in);
        }

        public GraphicBufferCompat[] newArray(int size) {
            return new GraphicBufferCompat[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }
}
+0 −16
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Log;
import android.view.SurfaceControl;

import com.android.systemui.OverviewProxyService.OverviewProxyListener;
import com.android.systemui.recents.events.EventBus;
@@ -41,7 +40,6 @@ import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.GraphicBufferCompat;
import com.android.systemui.stackdivider.Divider;
import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.policy.CallbackController;
@@ -94,20 +92,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis

    private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() {

        public GraphicBufferCompat screenshot(Rect sourceCrop, int width, int height, int minLayer,
                int maxLayer, boolean useIdentityTransform, int rotation) {
            if (!verifyCaller("screenshot")) {
                return null;
            }
            long token = Binder.clearCallingIdentity();
            try {
                return new GraphicBufferCompat(SurfaceControl.screenshotToBuffer(sourceCrop, width,
                        height, minLayer, maxLayer, useIdentityTransform, rotation));
            } finally {
                Binder.restoreCallingIdentity(token);
            }
        }

        public void startScreenPinning(int taskId) {
            if (!verifyCaller("startScreenPinning")) {
                return;