Merge changes from topic "screenshots_logs" into sc-qpr1-dev
* changes: Log additional UiEvents for long screenshots, include packageName requestScrollCapture: provide package name on exception Return packageName to scroll capture requests from SysUI
This commit is contained in:
@@ -53,6 +53,10 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
@Nullable
|
@Nullable
|
||||||
private String mWindowTitle = null;
|
private String mWindowTitle = null;
|
||||||
|
|
||||||
|
/** The package which owns the window. */
|
||||||
|
@Nullable
|
||||||
|
private String mPackageName = null;
|
||||||
|
|
||||||
/** Carries additional logging and debugging information when enabled. */
|
/** Carries additional logging and debugging information when enabled. */
|
||||||
@NonNull
|
@NonNull
|
||||||
@DataClass.PluralOf("message")
|
@DataClass.PluralOf("message")
|
||||||
@@ -77,7 +81,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Code below generated by codegen v1.0.22.
|
// Code below generated by codegen v1.0.23.
|
||||||
//
|
//
|
||||||
// DO NOT MODIFY!
|
// DO NOT MODIFY!
|
||||||
// CHECKSTYLE:OFF Generated code
|
// CHECKSTYLE:OFF Generated code
|
||||||
@@ -97,6 +101,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
@Nullable Rect windowBounds,
|
@Nullable Rect windowBounds,
|
||||||
@Nullable Rect boundsInWindow,
|
@Nullable Rect boundsInWindow,
|
||||||
@Nullable String windowTitle,
|
@Nullable String windowTitle,
|
||||||
|
@Nullable String packageName,
|
||||||
@NonNull ArrayList<String> messages) {
|
@NonNull ArrayList<String> messages) {
|
||||||
this.mDescription = description;
|
this.mDescription = description;
|
||||||
com.android.internal.util.AnnotationValidations.validate(
|
com.android.internal.util.AnnotationValidations.validate(
|
||||||
@@ -105,6 +110,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
this.mWindowBounds = windowBounds;
|
this.mWindowBounds = windowBounds;
|
||||||
this.mBoundsInWindow = boundsInWindow;
|
this.mBoundsInWindow = boundsInWindow;
|
||||||
this.mWindowTitle = windowTitle;
|
this.mWindowTitle = windowTitle;
|
||||||
|
this.mPackageName = packageName;
|
||||||
this.mMessages = messages;
|
this.mMessages = messages;
|
||||||
com.android.internal.util.AnnotationValidations.validate(
|
com.android.internal.util.AnnotationValidations.validate(
|
||||||
NonNull.class, null, mMessages);
|
NonNull.class, null, mMessages);
|
||||||
@@ -152,6 +158,14 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
return mWindowTitle;
|
return mWindowTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The package name of the process the window is owned by.
|
||||||
|
*/
|
||||||
|
@DataClass.Generated.Member
|
||||||
|
public @Nullable String getPackageName() {
|
||||||
|
return mPackageName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Carries additional logging and debugging information when enabled.
|
* Carries additional logging and debugging information when enabled.
|
||||||
*/
|
*/
|
||||||
@@ -172,6 +186,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
"windowBounds = " + mWindowBounds + ", " +
|
"windowBounds = " + mWindowBounds + ", " +
|
||||||
"boundsInWindow = " + mBoundsInWindow + ", " +
|
"boundsInWindow = " + mBoundsInWindow + ", " +
|
||||||
"windowTitle = " + mWindowTitle + ", " +
|
"windowTitle = " + mWindowTitle + ", " +
|
||||||
|
"packageName = " + mPackageName + ", " +
|
||||||
"messages = " + mMessages +
|
"messages = " + mMessages +
|
||||||
" }";
|
" }";
|
||||||
}
|
}
|
||||||
@@ -187,12 +202,14 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
if (mWindowBounds != null) flg |= 0x4;
|
if (mWindowBounds != null) flg |= 0x4;
|
||||||
if (mBoundsInWindow != null) flg |= 0x8;
|
if (mBoundsInWindow != null) flg |= 0x8;
|
||||||
if (mWindowTitle != null) flg |= 0x10;
|
if (mWindowTitle != null) flg |= 0x10;
|
||||||
|
if (mPackageName != null) flg |= 0x20;
|
||||||
dest.writeByte(flg);
|
dest.writeByte(flg);
|
||||||
dest.writeString(mDescription);
|
dest.writeString(mDescription);
|
||||||
if (mConnection != null) dest.writeStrongInterface(mConnection);
|
if (mConnection != null) dest.writeStrongInterface(mConnection);
|
||||||
if (mWindowBounds != null) dest.writeTypedObject(mWindowBounds, flags);
|
if (mWindowBounds != null) dest.writeTypedObject(mWindowBounds, flags);
|
||||||
if (mBoundsInWindow != null) dest.writeTypedObject(mBoundsInWindow, flags);
|
if (mBoundsInWindow != null) dest.writeTypedObject(mBoundsInWindow, flags);
|
||||||
if (mWindowTitle != null) dest.writeString(mWindowTitle);
|
if (mWindowTitle != null) dest.writeString(mWindowTitle);
|
||||||
|
if (mPackageName != null) dest.writeString(mPackageName);
|
||||||
dest.writeStringList(mMessages);
|
dest.writeStringList(mMessages);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,6 +230,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
Rect windowBounds = (flg & 0x4) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR);
|
Rect windowBounds = (flg & 0x4) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR);
|
||||||
Rect boundsInWindow = (flg & 0x8) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR);
|
Rect boundsInWindow = (flg & 0x8) == 0 ? null : (Rect) in.readTypedObject(Rect.CREATOR);
|
||||||
String windowTitle = (flg & 0x10) == 0 ? null : in.readString();
|
String windowTitle = (flg & 0x10) == 0 ? null : in.readString();
|
||||||
|
String packageName = (flg & 0x20) == 0 ? null : in.readString();
|
||||||
ArrayList<String> messages = new ArrayList<>();
|
ArrayList<String> messages = new ArrayList<>();
|
||||||
in.readStringList(messages);
|
in.readStringList(messages);
|
||||||
|
|
||||||
@@ -223,6 +241,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
this.mWindowBounds = windowBounds;
|
this.mWindowBounds = windowBounds;
|
||||||
this.mBoundsInWindow = boundsInWindow;
|
this.mBoundsInWindow = boundsInWindow;
|
||||||
this.mWindowTitle = windowTitle;
|
this.mWindowTitle = windowTitle;
|
||||||
|
this.mPackageName = packageName;
|
||||||
this.mMessages = messages;
|
this.mMessages = messages;
|
||||||
com.android.internal.util.AnnotationValidations.validate(
|
com.android.internal.util.AnnotationValidations.validate(
|
||||||
NonNull.class, null, mMessages);
|
NonNull.class, null, mMessages);
|
||||||
@@ -256,6 +275,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
private @Nullable Rect mWindowBounds;
|
private @Nullable Rect mWindowBounds;
|
||||||
private @Nullable Rect mBoundsInWindow;
|
private @Nullable Rect mBoundsInWindow;
|
||||||
private @Nullable String mWindowTitle;
|
private @Nullable String mWindowTitle;
|
||||||
|
private @Nullable String mPackageName;
|
||||||
private @NonNull ArrayList<String> mMessages;
|
private @NonNull ArrayList<String> mMessages;
|
||||||
|
|
||||||
private long mBuilderFieldsSet = 0L;
|
private long mBuilderFieldsSet = 0L;
|
||||||
@@ -318,13 +338,24 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The package name of the process the window is owned by.
|
||||||
|
*/
|
||||||
|
@DataClass.Generated.Member
|
||||||
|
public @NonNull Builder setPackageName(@NonNull String value) {
|
||||||
|
checkNotUsed();
|
||||||
|
mBuilderFieldsSet |= 0x20;
|
||||||
|
mPackageName = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Carries additional logging and debugging information when enabled.
|
* Carries additional logging and debugging information when enabled.
|
||||||
*/
|
*/
|
||||||
@DataClass.Generated.Member
|
@DataClass.Generated.Member
|
||||||
public @NonNull Builder setMessages(@NonNull ArrayList<String> value) {
|
public @NonNull Builder setMessages(@NonNull ArrayList<String> value) {
|
||||||
checkNotUsed();
|
checkNotUsed();
|
||||||
mBuilderFieldsSet |= 0x20;
|
mBuilderFieldsSet |= 0x40;
|
||||||
mMessages = value;
|
mMessages = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -340,7 +371,7 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
/** Builds the instance. This builder should not be touched after calling this! */
|
/** Builds the instance. This builder should not be touched after calling this! */
|
||||||
public @NonNull ScrollCaptureResponse build() {
|
public @NonNull ScrollCaptureResponse build() {
|
||||||
checkNotUsed();
|
checkNotUsed();
|
||||||
mBuilderFieldsSet |= 0x40; // Mark builder used
|
mBuilderFieldsSet |= 0x80; // Mark builder used
|
||||||
|
|
||||||
if ((mBuilderFieldsSet & 0x1) == 0) {
|
if ((mBuilderFieldsSet & 0x1) == 0) {
|
||||||
mDescription = "";
|
mDescription = "";
|
||||||
@@ -358,6 +389,9 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
mWindowTitle = null;
|
mWindowTitle = null;
|
||||||
}
|
}
|
||||||
if ((mBuilderFieldsSet & 0x20) == 0) {
|
if ((mBuilderFieldsSet & 0x20) == 0) {
|
||||||
|
mPackageName = null;
|
||||||
|
}
|
||||||
|
if ((mBuilderFieldsSet & 0x40) == 0) {
|
||||||
mMessages = new ArrayList<>();
|
mMessages = new ArrayList<>();
|
||||||
}
|
}
|
||||||
ScrollCaptureResponse o = new ScrollCaptureResponse(
|
ScrollCaptureResponse o = new ScrollCaptureResponse(
|
||||||
@@ -366,12 +400,13 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
mWindowBounds,
|
mWindowBounds,
|
||||||
mBoundsInWindow,
|
mBoundsInWindow,
|
||||||
mWindowTitle,
|
mWindowTitle,
|
||||||
|
mPackageName,
|
||||||
mMessages);
|
mMessages);
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkNotUsed() {
|
private void checkNotUsed() {
|
||||||
if ((mBuilderFieldsSet & 0x40) != 0) {
|
if ((mBuilderFieldsSet & 0x80) != 0) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"This Builder should not be reused. Use a new Builder instance instead");
|
"This Builder should not be reused. Use a new Builder instance instead");
|
||||||
}
|
}
|
||||||
@@ -379,10 +414,10 @@ public class ScrollCaptureResponse implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DataClass.Generated(
|
@DataClass.Generated(
|
||||||
time = 1614833185795L,
|
time = 1628630366187L,
|
||||||
codegenVersion = "1.0.22",
|
codegenVersion = "1.0.23",
|
||||||
sourceFile = "frameworks/base/core/java/android/view/ScrollCaptureResponse.java",
|
sourceFile = "frameworks/base/core/java/android/view/ScrollCaptureResponse.java",
|
||||||
inputSignatures = "private @android.annotation.NonNull java.lang.String mDescription\nprivate @android.annotation.Nullable @com.android.internal.util.DataClass.MaySetToNull android.view.IScrollCaptureConnection mConnection\nprivate @android.annotation.Nullable android.graphics.Rect mWindowBounds\nprivate @android.annotation.Nullable android.graphics.Rect mBoundsInWindow\nprivate @android.annotation.Nullable java.lang.String mWindowTitle\nprivate @android.annotation.NonNull @com.android.internal.util.DataClass.PluralOf(\"message\") java.util.ArrayList<java.lang.String> mMessages\npublic boolean isConnected()\npublic void close()\nclass ScrollCaptureResponse extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genGetters=true)")
|
inputSignatures = "private @android.annotation.NonNull java.lang.String mDescription\nprivate @android.annotation.Nullable @com.android.internal.util.DataClass.MaySetToNull android.view.IScrollCaptureConnection mConnection\nprivate @android.annotation.Nullable android.graphics.Rect mWindowBounds\nprivate @android.annotation.Nullable android.graphics.Rect mBoundsInWindow\nprivate @android.annotation.Nullable java.lang.String mWindowTitle\nprivate @android.annotation.Nullable java.lang.String mPackageName\nprivate @android.annotation.NonNull @com.android.internal.util.DataClass.PluralOf(\"message\") java.util.ArrayList<java.lang.String> mMessages\npublic boolean isConnected()\npublic void close()\nclass ScrollCaptureResponse extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genGetters=true)")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private void __metadata() {}
|
private void __metadata() {}
|
||||||
|
|
||||||
|
|||||||
@@ -9493,6 +9493,7 @@ public final class ViewRootImpl implements ViewParent,
|
|||||||
|
|
||||||
ScrollCaptureResponse.Builder response = new ScrollCaptureResponse.Builder();
|
ScrollCaptureResponse.Builder response = new ScrollCaptureResponse.Builder();
|
||||||
response.setWindowTitle(getTitle().toString());
|
response.setWindowTitle(getTitle().toString());
|
||||||
|
response.setPackageName(mContext.getPackageName());
|
||||||
|
|
||||||
StringWriter writer = new StringWriter();
|
StringWriter writer = new StringWriter();
|
||||||
IndentingPrintWriter pw = new IndentingPrintWriter(writer);
|
IndentingPrintWriter pw = new IndentingPrintWriter(writer);
|
||||||
|
|||||||
@@ -660,7 +660,7 @@ public class ScreenshotController {
|
|||||||
+ mLastScrollCaptureResponse.getWindowTitle() + "]");
|
+ mLastScrollCaptureResponse.getWindowTitle() + "]");
|
||||||
|
|
||||||
final ScrollCaptureResponse response = mLastScrollCaptureResponse;
|
final ScrollCaptureResponse response = mLastScrollCaptureResponse;
|
||||||
mScreenshotView.showScrollChip(/* onClick */ () -> {
|
mScreenshotView.showScrollChip(response.getPackageName(), /* onClick */ () -> {
|
||||||
DisplayMetrics displayMetrics = new DisplayMetrics();
|
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||||
getDefaultDisplay().getRealMetrics(displayMetrics);
|
getDefaultDisplay().getRealMetrics(displayMetrics);
|
||||||
Bitmap newScreenshot = captureScreenshot(
|
Bitmap newScreenshot = captureScreenshot(
|
||||||
|
|||||||
@@ -71,7 +71,13 @@ public enum ScreenshotEvent implements UiEventLogger.UiEventEnum {
|
|||||||
@UiEvent(doc = "User has shared a long screenshot")
|
@UiEvent(doc = "User has shared a long screenshot")
|
||||||
SCREENSHOT_LONG_SCREENSHOT_SHARE(689),
|
SCREENSHOT_LONG_SCREENSHOT_SHARE(689),
|
||||||
@UiEvent(doc = "User has sent a long screenshot to the editor")
|
@UiEvent(doc = "User has sent a long screenshot to the editor")
|
||||||
SCREENSHOT_LONG_SCREENSHOT_EDIT(690);
|
SCREENSHOT_LONG_SCREENSHOT_EDIT(690),
|
||||||
|
@UiEvent(doc = "A long screenshot capture has started")
|
||||||
|
SCREENSHOT_LONG_SCREENSHOT_STARTED(880),
|
||||||
|
@UiEvent(doc = "The long screenshot capture failed")
|
||||||
|
SCREENSHOT_LONG_SCREENSHOT_FAILURE(881),
|
||||||
|
@UiEvent(doc = "The long screenshot capture completed successfully")
|
||||||
|
SCREENSHOT_LONG_SCREENSHOT_COMPLETED(882);
|
||||||
|
|
||||||
private final int mId;
|
private final int mId;
|
||||||
|
|
||||||
|
|||||||
@@ -242,19 +242,21 @@ public class ScreenshotView extends FrameLayout implements
|
|||||||
/**
|
/**
|
||||||
* Called to display the scroll action chip when support is detected.
|
* Called to display the scroll action chip when support is detected.
|
||||||
*
|
*
|
||||||
|
* @param packageName the owning package of the window to be captured
|
||||||
* @param onClick the action to take when the chip is clicked.
|
* @param onClick the action to take when the chip is clicked.
|
||||||
*/
|
*/
|
||||||
public void showScrollChip(Runnable onClick) {
|
public void showScrollChip(String packageName, Runnable onClick) {
|
||||||
if (DEBUG_SCROLL) {
|
if (DEBUG_SCROLL) {
|
||||||
Log.d(TAG, "Showing Scroll option");
|
Log.d(TAG, "Showing Scroll option");
|
||||||
}
|
}
|
||||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_IMPRESSION);
|
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_IMPRESSION, 0, packageName);
|
||||||
mScrollChip.setVisibility(VISIBLE);
|
mScrollChip.setVisibility(VISIBLE);
|
||||||
mScrollChip.setOnClickListener((v) -> {
|
mScrollChip.setOnClickListener((v) -> {
|
||||||
if (DEBUG_INPUT) {
|
if (DEBUG_INPUT) {
|
||||||
Log.d(TAG, "scroll chip tapped");
|
Log.d(TAG, "scroll chip tapped");
|
||||||
}
|
}
|
||||||
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_REQUESTED);
|
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_REQUESTED, 0,
|
||||||
|
packageName);
|
||||||
onClick.run();
|
onClick.run();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import androidx.concurrent.futures.CallbackToFutureAdapter;
|
|||||||
import androidx.concurrent.futures.CallbackToFutureAdapter.Completer;
|
import androidx.concurrent.futures.CallbackToFutureAdapter.Completer;
|
||||||
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
|
import com.android.internal.logging.UiEventLogger;
|
||||||
import com.android.systemui.dagger.qualifiers.Background;
|
import com.android.systemui.dagger.qualifiers.Background;
|
||||||
import com.android.systemui.screenshot.ScrollCaptureClient.CaptureResult;
|
import com.android.systemui.screenshot.ScrollCaptureClient.CaptureResult;
|
||||||
import com.android.systemui.screenshot.ScrollCaptureClient.Session;
|
import com.android.systemui.screenshot.ScrollCaptureClient.Session;
|
||||||
@@ -61,6 +62,7 @@ public class ScrollCaptureController {
|
|||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final Executor mBgExecutor;
|
private final Executor mBgExecutor;
|
||||||
private final ImageTileSet mImageTileSet;
|
private final ImageTileSet mImageTileSet;
|
||||||
|
private final UiEventLogger mEventLogger;
|
||||||
private final ScrollCaptureClient mClient;
|
private final ScrollCaptureClient mClient;
|
||||||
|
|
||||||
private Completer<LongScreenshot> mCaptureCompleter;
|
private Completer<LongScreenshot> mCaptureCompleter;
|
||||||
@@ -69,6 +71,7 @@ public class ScrollCaptureController {
|
|||||||
private Session mSession;
|
private Session mSession;
|
||||||
private ListenableFuture<CaptureResult> mTileFuture;
|
private ListenableFuture<CaptureResult> mTileFuture;
|
||||||
private ListenableFuture<Void> mEndFuture;
|
private ListenableFuture<Void> mEndFuture;
|
||||||
|
private String mWindowOwner;
|
||||||
|
|
||||||
static class LongScreenshot {
|
static class LongScreenshot {
|
||||||
private final ImageTileSet mImageTileSet;
|
private final ImageTileSet mImageTileSet;
|
||||||
@@ -135,11 +138,12 @@ public class ScrollCaptureController {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ScrollCaptureController(Context context, @Background Executor bgExecutor,
|
ScrollCaptureController(Context context, @Background Executor bgExecutor,
|
||||||
ScrollCaptureClient client, ImageTileSet imageTileSet) {
|
ScrollCaptureClient client, ImageTileSet imageTileSet, UiEventLogger logger) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mBgExecutor = bgExecutor;
|
mBgExecutor = bgExecutor;
|
||||||
mClient = client;
|
mClient = client;
|
||||||
mImageTileSet = imageTileSet;
|
mImageTileSet = imageTileSet;
|
||||||
|
mEventLogger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@@ -157,6 +161,7 @@ public class ScrollCaptureController {
|
|||||||
ListenableFuture<LongScreenshot> run(ScrollCaptureResponse response) {
|
ListenableFuture<LongScreenshot> run(ScrollCaptureResponse response) {
|
||||||
return CallbackToFutureAdapter.getFuture(completer -> {
|
return CallbackToFutureAdapter.getFuture(completer -> {
|
||||||
mCaptureCompleter = completer;
|
mCaptureCompleter = completer;
|
||||||
|
mWindowOwner = response.getPackageName();
|
||||||
mBgExecutor.execute(() -> {
|
mBgExecutor.execute(() -> {
|
||||||
float maxPages = Settings.Secure.getFloat(mContext.getContentResolver(),
|
float maxPages = Settings.Secure.getFloat(mContext.getContentResolver(),
|
||||||
SETTING_KEY_MAX_PAGES, MAX_PAGES_DEFAULT);
|
SETTING_KEY_MAX_PAGES, MAX_PAGES_DEFAULT);
|
||||||
@@ -173,11 +178,13 @@ public class ScrollCaptureController {
|
|||||||
if (LogConfig.DEBUG_SCROLL) {
|
if (LogConfig.DEBUG_SCROLL) {
|
||||||
Log.d(TAG, "got session " + mSession);
|
Log.d(TAG, "got session " + mSession);
|
||||||
}
|
}
|
||||||
|
mEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_STARTED, 0, mWindowOwner);
|
||||||
requestNextTile(0);
|
requestNextTile(0);
|
||||||
} catch (InterruptedException | ExecutionException e) {
|
} catch (InterruptedException | ExecutionException e) {
|
||||||
// Failure to start, propagate to caller
|
// Failure to start, propagate to caller
|
||||||
Log.e(TAG, "session start failed!");
|
Log.e(TAG, "session start failed!");
|
||||||
mCaptureCompleter.setException(e);
|
mCaptureCompleter.setException(e);
|
||||||
|
mEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_FAILURE, 0, mWindowOwner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,6 +304,11 @@ public class ScrollCaptureController {
|
|||||||
if (LogConfig.DEBUG_SCROLL) {
|
if (LogConfig.DEBUG_SCROLL) {
|
||||||
Log.d(TAG, "finishCapture()");
|
Log.d(TAG, "finishCapture()");
|
||||||
}
|
}
|
||||||
|
if (mImageTileSet.getHeight() > 0) {
|
||||||
|
mEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_COMPLETED, 0, mWindowOwner);
|
||||||
|
} else {
|
||||||
|
mEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_FAILURE, 0, mWindowOwner);
|
||||||
|
}
|
||||||
mEndFuture = mSession.end();
|
mEndFuture = mSession.end();
|
||||||
mEndFuture.addListener(() -> {
|
mEndFuture.addListener(() -> {
|
||||||
if (LogConfig.DEBUG_SCROLL) {
|
if (LogConfig.DEBUG_SCROLL) {
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import android.view.ScrollCaptureResponse;
|
|||||||
|
|
||||||
import androidx.test.filters.SmallTest;
|
import androidx.test.filters.SmallTest;
|
||||||
|
|
||||||
|
import com.android.internal.logging.testing.UiEventLoggerFake;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
import com.android.systemui.screenshot.ScrollCaptureClient.Session;
|
import com.android.systemui.screenshot.ScrollCaptureClient.Session;
|
||||||
|
|
||||||
@@ -274,7 +275,8 @@ public class ScrollCaptureControllerTest extends SysuiTestCase {
|
|||||||
when(client.start(/* response */ any(), /* maxPages */ anyFloat()))
|
when(client.start(/* response */ any(), /* maxPages */ anyFloat()))
|
||||||
.thenReturn(immediateFuture(session));
|
.thenReturn(immediateFuture(session));
|
||||||
return new ScrollCaptureController(context, context.getMainExecutor(),
|
return new ScrollCaptureController(context, context.getMainExecutor(),
|
||||||
client, new ImageTileSet(context.getMainThreadHandler()));
|
client, new ImageTileSet(context.getMainThreadHandler()),
|
||||||
|
new UiEventLoggerFake());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7061,6 +7061,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
"requestScrollCapture: caught exception dispatching to window."
|
"requestScrollCapture: caught exception dispatching to window."
|
||||||
+ "token=%s", targetWindow.mClient.asBinder());
|
+ "token=%s", targetWindow.mClient.asBinder());
|
||||||
responseBuilder.setWindowTitle(targetWindow.getName());
|
responseBuilder.setWindowTitle(targetWindow.getName());
|
||||||
|
responseBuilder.setPackageName(targetWindow.getOwningPackage());
|
||||||
responseBuilder.setDescription(String.format("caught exception: %s", e));
|
responseBuilder.setDescription(String.format("caught exception: %s", e));
|
||||||
listener.onScrollCaptureResponse(responseBuilder.build());
|
listener.onScrollCaptureResponse(responseBuilder.build());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user