Loading quickstep/src/com/android/quickstep/SystemUiProxy.java +4 −7 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.ShortcutInfo; import android.content.pm.ShortcutInfo; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.os.Bundle; import android.os.Bundle; import android.os.Handler; import android.os.Handler; Loading @@ -51,10 +50,10 @@ import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; import androidx.annotation.WorkerThread; import com.android.internal.logging.InstanceId; import com.android.internal.logging.InstanceId; import com.android.internal.util.ScreenshotRequest; import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.SplitConfigurationOptions; import com.android.launcher3.util.SplitConfigurationOptions; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController; import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController; import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController; import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController; import com.android.systemui.shared.system.smartspace.SmartspaceState; import com.android.systemui.shared.system.smartspace.SmartspaceState; Loading Loading @@ -384,14 +383,12 @@ public class SystemUiProxy implements ISystemUiProxy { } } @Override @Override public void handleImageBundleAsScreenshot(Bundle screenImageBundle, Rect locationInScreen, public void takeScreenshot(ScreenshotRequest request) { Insets visibleInsets, Task.TaskKey task) { if (mSystemUiProxy != null) { if (mSystemUiProxy != null) { try { try { mSystemUiProxy.handleImageBundleAsScreenshot(screenImageBundle, locationInScreen, mSystemUiProxy.takeScreenshot(request); visibleInsets, task); } catch (RemoteException e) { } catch (RemoteException e) { Log.w(TAG, "Failed call handleImageBundleAsScreenshot"); Log.w(TAG, "Failed call takeScreenshot"); } } } } } } Loading quickstep/src/com/android/quickstep/util/ImageActionUtils.java +14 −6 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.quickstep.util; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION; import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION; import static android.view.WindowManager.ScreenshotSource.SCREENSHOT_OVERVIEW; import static android.view.WindowManager.TAKE_SCREENSHOT_PROVIDED_IMAGE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR; import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR; Loading Loading @@ -47,7 +49,7 @@ import androidx.annotation.WorkerThread; import androidx.core.content.FileProvider; import androidx.core.content.FileProvider; import com.android.internal.app.ChooserActivity; import com.android.internal.app.ChooserActivity; import com.android.internal.util.ScreenshotHelper; import com.android.internal.util.ScreenshotRequest; import com.android.launcher3.BuildConfig; import com.android.launcher3.BuildConfig; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.SystemUiProxy; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.recents.model.Task; Loading @@ -74,11 +76,17 @@ public class ImageActionUtils { * Saves screenshot to location determine by SystemUiProxy * Saves screenshot to location determine by SystemUiProxy */ */ public static void saveScreenshot(SystemUiProxy systemUiProxy, Bitmap screenshot, public static void saveScreenshot(SystemUiProxy systemUiProxy, Bitmap screenshot, Rect screenshotBounds, Rect screenshotBounds, Insets visibleInsets, Task.TaskKey task) { Insets visibleInsets, Task.TaskKey task) { ScreenshotRequest request = systemUiProxy.handleImageBundleAsScreenshot( new ScreenshotRequest.Builder(TAKE_SCREENSHOT_PROVIDED_IMAGE, SCREENSHOT_OVERVIEW) ScreenshotHelper.HardwareBitmapBundler.hardwareBitmapToBundle(screenshot), .setTopComponent(task.sourceComponent) screenshotBounds, visibleInsets, task); .setTaskId(task.id) .setUserId(task.userId) .setBitmap(screenshot) .setBoundsOnScreen(screenshotBounds) .setInsets(visibleInsets) .build(); systemUiProxy.takeScreenshot(request); } } /** /** Loading Loading
quickstep/src/com/android/quickstep/SystemUiProxy.java +4 −7 Original line number Original line Diff line number Diff line Loading @@ -29,7 +29,6 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.ShortcutInfo; import android.content.pm.ShortcutInfo; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.os.Bundle; import android.os.Bundle; import android.os.Handler; import android.os.Handler; Loading @@ -51,10 +50,10 @@ import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; import androidx.annotation.WorkerThread; import com.android.internal.logging.InstanceId; import com.android.internal.logging.InstanceId; import com.android.internal.util.ScreenshotRequest; import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.MainThreadInitializedObject; import com.android.launcher3.util.SplitConfigurationOptions; import com.android.launcher3.util.SplitConfigurationOptions; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController; import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController; import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController; import com.android.systemui.shared.system.smartspace.ISysuiUnlockAnimationController; import com.android.systemui.shared.system.smartspace.SmartspaceState; import com.android.systemui.shared.system.smartspace.SmartspaceState; Loading Loading @@ -384,14 +383,12 @@ public class SystemUiProxy implements ISystemUiProxy { } } @Override @Override public void handleImageBundleAsScreenshot(Bundle screenImageBundle, Rect locationInScreen, public void takeScreenshot(ScreenshotRequest request) { Insets visibleInsets, Task.TaskKey task) { if (mSystemUiProxy != null) { if (mSystemUiProxy != null) { try { try { mSystemUiProxy.handleImageBundleAsScreenshot(screenImageBundle, locationInScreen, mSystemUiProxy.takeScreenshot(request); visibleInsets, task); } catch (RemoteException e) { } catch (RemoteException e) { Log.w(TAG, "Failed call handleImageBundleAsScreenshot"); Log.w(TAG, "Failed call takeScreenshot"); } } } } } } Loading
quickstep/src/com/android/quickstep/util/ImageActionUtils.java +14 −6 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.quickstep.util; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION; import static android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION; import static android.view.WindowManager.ScreenshotSource.SCREENSHOT_OVERVIEW; import static android.view.WindowManager.TAKE_SCREENSHOT_PROVIDED_IMAGE; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR; import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR; Loading Loading @@ -47,7 +49,7 @@ import androidx.annotation.WorkerThread; import androidx.core.content.FileProvider; import androidx.core.content.FileProvider; import com.android.internal.app.ChooserActivity; import com.android.internal.app.ChooserActivity; import com.android.internal.util.ScreenshotHelper; import com.android.internal.util.ScreenshotRequest; import com.android.launcher3.BuildConfig; import com.android.launcher3.BuildConfig; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.SystemUiProxy; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.recents.model.Task; Loading @@ -74,11 +76,17 @@ public class ImageActionUtils { * Saves screenshot to location determine by SystemUiProxy * Saves screenshot to location determine by SystemUiProxy */ */ public static void saveScreenshot(SystemUiProxy systemUiProxy, Bitmap screenshot, public static void saveScreenshot(SystemUiProxy systemUiProxy, Bitmap screenshot, Rect screenshotBounds, Rect screenshotBounds, Insets visibleInsets, Task.TaskKey task) { Insets visibleInsets, Task.TaskKey task) { ScreenshotRequest request = systemUiProxy.handleImageBundleAsScreenshot( new ScreenshotRequest.Builder(TAKE_SCREENSHOT_PROVIDED_IMAGE, SCREENSHOT_OVERVIEW) ScreenshotHelper.HardwareBitmapBundler.hardwareBitmapToBundle(screenshot), .setTopComponent(task.sourceComponent) screenshotBounds, visibleInsets, task); .setTaskId(task.id) .setUserId(task.userId) .setBitmap(screenshot) .setBoundsOnScreen(screenshotBounds) .setInsets(visibleInsets) .build(); systemUiProxy.takeScreenshot(request); } } /** /** Loading