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

Commit 7243dc6c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11551442 from 9168c3c7 to 24Q3-release

Change-Id: I1ac2eb53eca5dd8aecc2c2ef949d9aa6ff585541
parents 11c6822c 9168c3c7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();
+0 −13
Original line number Diff line number Diff line
@@ -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.
+16 −0
Original line number Diff line number Diff line
@@ -309,6 +309,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>

    private Object mUserTag;

    private boolean mReleaseSurfaces = false;

    /**
     * Construct empty request.
     *
@@ -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);
@@ -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.
     *
+20 −0
Original line number Diff line number Diff line
@@ -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),
@@ -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
+26 −6
Original line number Diff line number Diff line
@@ -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;
@@ -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