Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -19675,6 +19675,7 @@ package android.hardware.camera2 { public final class CaptureRequest extends android.hardware.camera2.CameraMetadata<android.hardware.camera2.CaptureRequest.Key<?>> implements android.os.Parcelable { method public int describeContents(); method @FlaggedApi("com.android.internal.camera.flags.surface_leak_fix") protected void finalize(); method @Nullable public <T> T get(android.hardware.camera2.CaptureRequest.Key<T>); method @NonNull public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getKeys(); method @Nullable public Object getTag(); core/java/android/hardware/OverlayProperties.java +0 −13 Original line number Diff line number Diff line Loading @@ -69,19 +69,6 @@ public final class OverlayProperties implements Parcelable { return sDefaultOverlayProperties; } /** * @return True if the device can support fp16, false otherwise. * TODO: Move this to isCombinationSupported once the flag flips * @hide */ public boolean isFp16SupportedForHdr() { if (mNativeObject == 0) { return false; } return nIsCombinationSupported( mNativeObject, DataSpace.DATASPACE_SCRGB, HardwareBuffer.RGBA_FP16); } /** * Indicates that hardware composition of a buffer encoded with the provided {@link DataSpace} * and {@link HardwareBuffer.Format} is supported on the device. Loading core/java/android/hardware/camera2/CaptureRequest.java +16 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> private Object mUserTag; private boolean mReleaseSurfaces = false; /** * Construct empty request. * Loading Loading @@ -610,6 +612,9 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader(), Surface.class); if (parcelableArray != null) { if (Flags.surfaceLeakFix()) { mReleaseSurfaces = true; } for (Parcelable p : parcelableArray) { Surface s = (Surface) p; mSurfaceSet.add(s); Loading Loading @@ -792,6 +797,17 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> } } @SuppressWarnings("Finalize") @FlaggedApi(Flags.FLAG_SURFACE_LEAK_FIX) @Override protected void finalize() { if (mReleaseSurfaces) { for (Surface s : mSurfaceSet) { s.release(); } } } /** * A builder for capture requests. * Loading core/java/android/hardware/camera2/extension/SessionProcessor.java +20 −0 Original line number Diff line number Diff line Loading @@ -363,11 +363,20 @@ public abstract class SessionProcessor { private final class SessionProcessorImpl extends ISessionProcessorImpl.Stub { private long mVendorId = -1; OutputSurface mImageCaptureSurface; OutputSurface mPreviewSurface; OutputSurface mPostviewSurface; @Override public CameraSessionConfig initSession(IBinder token, String cameraId, Map<String, CameraMetadataNative> charsMap, OutputSurface previewSurface, OutputSurface imageCaptureSurface, OutputSurface postviewSurface) throws RemoteException { if (Flags.surfaceLeakFix()) { mPreviewSurface = previewSurface; mPostviewSurface = postviewSurface; mImageCaptureSurface = imageCaptureSurface; } ExtensionConfiguration config = SessionProcessor.this.initSession(token, cameraId, new CharacteristicsMap(charsMap), new CameraOutputSurface(previewSurface), Loading @@ -390,6 +399,17 @@ public abstract class SessionProcessor { @Override public void deInitSession(IBinder token) throws RemoteException { SessionProcessor.this.deInitSession(token); if (Flags.surfaceLeakFix()) { if ((mPreviewSurface != null) && (mPreviewSurface.surface != null)) { mPreviewSurface.surface.release(); } if ((mImageCaptureSurface != null) && (mImageCaptureSurface.surface != null)) { mImageCaptureSurface.surface.release(); } if ((mPostviewSurface != null) && (mPostviewSurface.surface != null)) { mPostviewSurface.surface.release(); } } } @Override Loading core/java/android/hardware/input/InputSettings.java +26 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.AppGlobals; import android.content.Context; import android.os.UserHandle; import android.provider.Settings; Loading Loading @@ -393,16 +394,35 @@ public class InputSettings { * * @hide */ public static boolean isStylusPointerIconEnabled(@NonNull Context context) { public static boolean isStylusPointerIconEnabled(@NonNull Context context, boolean forceReloadSetting) { if (InputProperties.force_enable_stylus_pointer_icon().orElse(false)) { // Sysprop override is set return true; } return context.getResources() .getBoolean(com.android.internal.R.bool.config_enableStylusPointerIcon) && Settings.Secure.getIntForUser(context.getContentResolver(), if (!context.getResources().getBoolean( com.android.internal.R.bool.config_enableStylusPointerIcon)) { // Stylus pointer icons are disabled for the build return false; } if (forceReloadSetting) { return Settings.Secure.getIntForUser(context.getContentResolver(), Settings.Secure.STYLUS_POINTER_ICON_ENABLED, DEFAULT_STYLUS_POINTER_ICON_ENABLED, UserHandle.USER_CURRENT_OR_SELF) != 0; } return AppGlobals.getIntCoreSetting(Settings.Secure.STYLUS_POINTER_ICON_ENABLED, DEFAULT_STYLUS_POINTER_ICON_ENABLED) != 0; } /** * Whether a pointer icon will be shown over the location of a stylus pointer. * * @hide * @see #isStylusPointerIconEnabled(Context, boolean) */ public static boolean isStylusPointerIconEnabled(@NonNull Context context) { return isStylusPointerIconEnabled(context, false /* forceReloadSetting */); } /** * Whether Accessibility bounce keys feature is enabled. Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -19675,6 +19675,7 @@ package android.hardware.camera2 { public final class CaptureRequest extends android.hardware.camera2.CameraMetadata<android.hardware.camera2.CaptureRequest.Key<?>> implements android.os.Parcelable { method public int describeContents(); method @FlaggedApi("com.android.internal.camera.flags.surface_leak_fix") protected void finalize(); method @Nullable public <T> T get(android.hardware.camera2.CaptureRequest.Key<T>); method @NonNull public java.util.List<android.hardware.camera2.CaptureRequest.Key<?>> getKeys(); method @Nullable public Object getTag();
core/java/android/hardware/OverlayProperties.java +0 −13 Original line number Diff line number Diff line Loading @@ -69,19 +69,6 @@ public final class OverlayProperties implements Parcelable { return sDefaultOverlayProperties; } /** * @return True if the device can support fp16, false otherwise. * TODO: Move this to isCombinationSupported once the flag flips * @hide */ public boolean isFp16SupportedForHdr() { if (mNativeObject == 0) { return false; } return nIsCombinationSupported( mNativeObject, DataSpace.DATASPACE_SCRGB, HardwareBuffer.RGBA_FP16); } /** * Indicates that hardware composition of a buffer encoded with the provided {@link DataSpace} * and {@link HardwareBuffer.Format} is supported on the device. Loading
core/java/android/hardware/camera2/CaptureRequest.java +16 −0 Original line number Diff line number Diff line Loading @@ -309,6 +309,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> private Object mUserTag; private boolean mReleaseSurfaces = false; /** * Construct empty request. * Loading Loading @@ -610,6 +612,9 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader(), Surface.class); if (parcelableArray != null) { if (Flags.surfaceLeakFix()) { mReleaseSurfaces = true; } for (Parcelable p : parcelableArray) { Surface s = (Surface) p; mSurfaceSet.add(s); Loading Loading @@ -792,6 +797,17 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> } } @SuppressWarnings("Finalize") @FlaggedApi(Flags.FLAG_SURFACE_LEAK_FIX) @Override protected void finalize() { if (mReleaseSurfaces) { for (Surface s : mSurfaceSet) { s.release(); } } } /** * A builder for capture requests. * Loading
core/java/android/hardware/camera2/extension/SessionProcessor.java +20 −0 Original line number Diff line number Diff line Loading @@ -363,11 +363,20 @@ public abstract class SessionProcessor { private final class SessionProcessorImpl extends ISessionProcessorImpl.Stub { private long mVendorId = -1; OutputSurface mImageCaptureSurface; OutputSurface mPreviewSurface; OutputSurface mPostviewSurface; @Override public CameraSessionConfig initSession(IBinder token, String cameraId, Map<String, CameraMetadataNative> charsMap, OutputSurface previewSurface, OutputSurface imageCaptureSurface, OutputSurface postviewSurface) throws RemoteException { if (Flags.surfaceLeakFix()) { mPreviewSurface = previewSurface; mPostviewSurface = postviewSurface; mImageCaptureSurface = imageCaptureSurface; } ExtensionConfiguration config = SessionProcessor.this.initSession(token, cameraId, new CharacteristicsMap(charsMap), new CameraOutputSurface(previewSurface), Loading @@ -390,6 +399,17 @@ public abstract class SessionProcessor { @Override public void deInitSession(IBinder token) throws RemoteException { SessionProcessor.this.deInitSession(token); if (Flags.surfaceLeakFix()) { if ((mPreviewSurface != null) && (mPreviewSurface.surface != null)) { mPreviewSurface.surface.release(); } if ((mImageCaptureSurface != null) && (mImageCaptureSurface.surface != null)) { mImageCaptureSurface.surface.release(); } if ((mPostviewSurface != null) && (mPostviewSurface.surface != null)) { mPostviewSurface.surface.release(); } } } @Override Loading
core/java/android/hardware/input/InputSettings.java +26 −6 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SuppressLint; import android.annotation.TestApi; import android.app.AppGlobals; import android.content.Context; import android.os.UserHandle; import android.provider.Settings; Loading Loading @@ -393,16 +394,35 @@ public class InputSettings { * * @hide */ public static boolean isStylusPointerIconEnabled(@NonNull Context context) { public static boolean isStylusPointerIconEnabled(@NonNull Context context, boolean forceReloadSetting) { if (InputProperties.force_enable_stylus_pointer_icon().orElse(false)) { // Sysprop override is set return true; } return context.getResources() .getBoolean(com.android.internal.R.bool.config_enableStylusPointerIcon) && Settings.Secure.getIntForUser(context.getContentResolver(), if (!context.getResources().getBoolean( com.android.internal.R.bool.config_enableStylusPointerIcon)) { // Stylus pointer icons are disabled for the build return false; } if (forceReloadSetting) { return Settings.Secure.getIntForUser(context.getContentResolver(), Settings.Secure.STYLUS_POINTER_ICON_ENABLED, DEFAULT_STYLUS_POINTER_ICON_ENABLED, UserHandle.USER_CURRENT_OR_SELF) != 0; } return AppGlobals.getIntCoreSetting(Settings.Secure.STYLUS_POINTER_ICON_ENABLED, DEFAULT_STYLUS_POINTER_ICON_ENABLED) != 0; } /** * Whether a pointer icon will be shown over the location of a stylus pointer. * * @hide * @see #isStylusPointerIconEnabled(Context, boolean) */ public static boolean isStylusPointerIconEnabled(@NonNull Context context) { return isStylusPointerIconEnabled(context, false /* forceReloadSetting */); } /** * Whether Accessibility bounce keys feature is enabled. Loading