Loading core/java/android/content/pm/ILauncherApps.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -133,4 +133,7 @@ interface ILauncherApps { void setArchiveCompatibilityOptions(boolean enableIconOverlay, boolean enableUnarchivalConfirmation); List<UserHandle> getUserProfiles(); /** Saves view capture data to the wm trace directory. */ void saveViewCaptureData(); } core/java/android/content/pm/LauncherApps.java +13 −0 Original line number Diff line number Diff line Loading @@ -1327,6 +1327,19 @@ public class LauncherApps { } } /** * Saves view capture data to the default location. * @hide */ @RequiresPermission(READ_FRAME_BUFFER) public void saveViewCaptureData() { try { mService.saveViewCaptureData(); } catch (RemoteException e) { e.rethrowAsRuntimeException(); } } /** * Unregister a callback, so that it won't be called when LauncherApps dumps. * @hide Loading packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingService.kt +5 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.recordissue import android.app.NotificationManager import android.content.Context import android.content.Intent import android.content.pm.LauncherApps import android.content.res.Resources import android.net.Uri import android.os.Handler Loading Loading @@ -93,6 +94,10 @@ constructor( } ACTION_STOP, ACTION_STOP_NOTIF -> { // ViewCapture needs to save it's data before it is disabled, or else the data will // be lost. This is expected to change in the near future, and when that happens // this line should be removed. getSystemService(LauncherApps::class.java)?.saveViewCaptureData() TraceUtils.traceStop(contentResolver) } ACTION_SHARE -> { Loading services/core/java/com/android/server/pm/LauncherAppsService.java +12 −0 Original line number Diff line number Diff line Loading @@ -2114,6 +2114,18 @@ public class LauncherAppsService extends SystemService { } } @RequiresPermission(READ_FRAME_BUFFER) @Override public void saveViewCaptureData() { int status = checkCallingOrSelfPermissionForPreflight(mContext, READ_FRAME_BUFFER); if (PERMISSION_GRANTED == status) { forEachViewCaptureWindow(this::dumpViewCaptureDataToWmTrace); } else { Log.w(TAG, "caller lacks permissions to save view capture data"); } } @RequiresPermission(READ_FRAME_BUFFER) @Override public void registerDumpCallback(@NonNull IDumpCallback cb) { Loading Loading
core/java/android/content/pm/ILauncherApps.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -133,4 +133,7 @@ interface ILauncherApps { void setArchiveCompatibilityOptions(boolean enableIconOverlay, boolean enableUnarchivalConfirmation); List<UserHandle> getUserProfiles(); /** Saves view capture data to the wm trace directory. */ void saveViewCaptureData(); }
core/java/android/content/pm/LauncherApps.java +13 −0 Original line number Diff line number Diff line Loading @@ -1327,6 +1327,19 @@ public class LauncherApps { } } /** * Saves view capture data to the default location. * @hide */ @RequiresPermission(READ_FRAME_BUFFER) public void saveViewCaptureData() { try { mService.saveViewCaptureData(); } catch (RemoteException e) { e.rethrowAsRuntimeException(); } } /** * Unregister a callback, so that it won't be called when LauncherApps dumps. * @hide Loading
packages/SystemUI/src/com/android/systemui/recordissue/IssueRecordingService.kt +5 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.recordissue import android.app.NotificationManager import android.content.Context import android.content.Intent import android.content.pm.LauncherApps import android.content.res.Resources import android.net.Uri import android.os.Handler Loading Loading @@ -93,6 +94,10 @@ constructor( } ACTION_STOP, ACTION_STOP_NOTIF -> { // ViewCapture needs to save it's data before it is disabled, or else the data will // be lost. This is expected to change in the near future, and when that happens // this line should be removed. getSystemService(LauncherApps::class.java)?.saveViewCaptureData() TraceUtils.traceStop(contentResolver) } ACTION_SHARE -> { Loading
services/core/java/com/android/server/pm/LauncherAppsService.java +12 −0 Original line number Diff line number Diff line Loading @@ -2114,6 +2114,18 @@ public class LauncherAppsService extends SystemService { } } @RequiresPermission(READ_FRAME_BUFFER) @Override public void saveViewCaptureData() { int status = checkCallingOrSelfPermissionForPreflight(mContext, READ_FRAME_BUFFER); if (PERMISSION_GRANTED == status) { forEachViewCaptureWindow(this::dumpViewCaptureDataToWmTrace); } else { Log.w(TAG, "caller lacks permissions to save view capture data"); } } @RequiresPermission(READ_FRAME_BUFFER) @Override public void registerDumpCallback(@NonNull IDumpCallback cb) { Loading