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

Commit 989ffba0 authored by Johannes Gallmann's avatar Johannes Gallmann Committed by Android (Google) Code Review
Browse files

Merge "Extracting ViewCapture into common Library" into tm-qpr-dev

parents 5db9942c 6518efce
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -153,6 +153,7 @@ android_library {
        "androidx.cardview_cardview",
        "com.google.android.material_material",
        "iconloader_base",
        "view_capture"
    ],
    manifest: "AndroidManifest-common.xml",
    sdk_version: "current",

protos/view_capture.proto

deleted100644 → 0
+0 −59
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 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.launcher3.view;

option java_outer_classname = "ViewCaptureData";

message ExportedData {

  repeated FrameData frameData = 1;
  repeated string classname = 2;
}

message FrameData {
  optional int64 timestamp = 1;
  optional ViewNode node = 2;
}

message ViewNode {
  optional int32 classname_index = 1;
  optional int32 hashcode = 2;

  repeated ViewNode children = 3;

  optional string id = 4;
  optional int32 left = 5;
  optional int32 top = 6;
  optional int32 width = 7;
  optional int32 height = 8;
  optional int32 scrollX = 9;
  optional int32 scrollY = 10;

  optional float translationX = 11;
  optional float translationY = 12;
  optional float scaleX = 13 [default = 1];
  optional float scaleY = 14 [default = 1];
  optional float alpha = 15 [default = 1];

  optional bool willNotDraw = 16;
  optional bool clipChildren = 17;
  optional int32 visibility = 18;

  optional float elevation = 19;
}
+7 −5
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 * Copyright (C) 2022 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.
@@ -58,6 +58,7 @@ import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.hardware.SensorManager;
import android.hardware.devicestate.DeviceStateManager;
import android.media.permission.SafeCloseable;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.IBinder;
@@ -71,6 +72,7 @@ import android.window.SplashScreen;

import androidx.annotation.Nullable;

import com.android.app.viewcapture.ViewCapture;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherSettings.Favorites;
@@ -119,7 +121,6 @@ import com.android.launcher3.util.ObjectWrapper;
import com.android.launcher3.util.PendingRequestArgs;
import com.android.launcher3.util.PendingSplitSelectInfo;
import com.android.launcher3.util.RunnableList;
import com.android.launcher3.util.SafeCloseable;
import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.widget.LauncherAppWidgetHost;
@@ -135,7 +136,6 @@ import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.quickstep.util.RemoteFadeOutAnimationListener;
import com.android.quickstep.util.SplitSelectStateController;
import com.android.quickstep.util.TISBindHelper;
import com.android.quickstep.util.ViewCapture;
import com.android.quickstep.views.OverviewActionsView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
@@ -402,7 +402,7 @@ public class QuickstepLauncher extends Launcher {

        super.onDestroy();
        mHotseatPredictionController.destroy();
        mViewCapture.close();
        if (mViewCapture != null) mViewCapture.close();
    }

    @Override
@@ -503,7 +503,9 @@ public class QuickstepLauncher extends Launcher {
        }
        addMultiWindowModeChangedListener(mDepthController);
        initUnfoldTransitionProgressProvider();
        mViewCapture = ViewCapture.INSTANCE.get(this).startCapture(getWindow());
        if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
            mViewCapture = ViewCapture.getInstance().startCapture(getWindow());
        }
    }

    @Override
+5 −3
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 * Copyright (C) 2022 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.
@@ -67,6 +67,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;

import com.android.app.viewcapture.ViewCapture;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
@@ -103,7 +104,6 @@ import com.android.quickstep.util.ActiveGestureLog.CompoundString;
import com.android.quickstep.util.ProtoTracer;
import com.android.quickstep.util.ProxyScreenStatusProvider;
import com.android.quickstep.util.SplitScreenBounds;
import com.android.quickstep.util.ViewCapture;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.ISystemUiProxy;
import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -1238,7 +1238,9 @@ public class TouchInteractionService extends Service
            }
            mTaskbarManager.dumpLogs("", pw);

            ViewCapture.INSTANCE.get(this).dump(pw, fd);
            if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) {
                ViewCapture.getInstance().dump(pw, fd, this);
            }
        }
    }

+0 −541

File deleted.

Preview size limit exceeded, changes collapsed.