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

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

Snap for 10342904 from e1c1711e to udc-qpr1-release

Change-Id: If9cc42b7699de536a6fa6f9fffd26024ff66284b
parents f3121190 e1c1711e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ public final class WifiSsidPolicy implements Parcelable {
    }

    /**
     * Two instances of WifiSsidPolicy is considered equal if they have
     * Two instances of WifiSsidPolicy are considered equal if they have
     * the same WifiSsidPolicyType and the same set of WifiSsids
     */
    @Override
+0 −18
Original line number Diff line number Diff line
@@ -2628,15 +2628,6 @@ public class PackageParser {
            return Build.VERSION_CODES.CUR_DEVELOPMENT;
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                targetCode)) {
            Slog.w(TAG, "Package requires development platform " + targetCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return Build.VERSION.SDK_INT;
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
        if (platformSdkCodenames.length > 0) {
            outError[0] = "Requires development platform " + targetCode
@@ -2708,15 +2699,6 @@ public class PackageParser {
            return Build.VERSION_CODES.CUR_DEVELOPMENT;
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                minCode)) {
            Slog.w(TAG, "Package requires min development platform " + minCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return Build.VERSION.SDK_INT;
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
        if (platformSdkCodenames.length > 0) {
            outError[0] = "Requires development platform " + minCode
+8 −25
Original line number Diff line number Diff line
@@ -316,15 +316,6 @@ public class FrameworkParsingPackageUtils {
            return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                        minCode)) {
            Slog.w(TAG, "Parsed package requires min development platform " + minCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return input.success(Build.VERSION.SDK_INT);
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
        if (platformSdkCodenames.length > 0) {
            return input.error(PackageManager.INSTALL_FAILED_OLDER_SDK,
@@ -377,27 +368,19 @@ public class FrameworkParsingPackageUtils {
            return input.success(targetVers);
        }

        // If it's a pre-release SDK and the codename matches this platform, it
        // definitely targets this SDK.
        if (matchTargetCode(platformSdkCodenames, targetCode)) {
            return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
        }

        // STOPSHIP: hack for the pre-release SDK
        if (platformSdkCodenames.length == 0
                && Build.VERSION.KNOWN_CODENAMES.stream().max(String::compareTo).orElse("").equals(
                        targetCode)) {
            Slog.w(TAG, "Parsed package requires development platform " + targetCode
                    + ", returning current version " + Build.VERSION.SDK_INT);
            return input.success(Build.VERSION.SDK_INT);
        }

        try {
            if (allowUnknownCodenames && UnboundedSdkLevel.isAtMost(targetCode)) {
                return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
            }
        } catch (IllegalArgumentException e) {
            return input.error(PackageManager.INSTALL_FAILED_OLDER_SDK, "Bad package SDK");
            // isAtMost() throws it when encountering an older SDK codename
            return input.error(PackageManager.INSTALL_FAILED_OLDER_SDK, e.getMessage());
        }

        // If it's a pre-release SDK and the codename matches this platform, it
        // definitely targets this SDK.
        if (matchTargetCode(platformSdkCodenames, targetCode)) {
            return input.success(Build.VERSION_CODES.CUR_DEVELOPMENT);
        }

        // Otherwise, we're looking at an incompatible pre-release SDK.
+59 −23
Original line number Diff line number Diff line
@@ -77,18 +77,18 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
    private static final String TAG = "CameraAdvancedExtensionSessionImpl";

    private final Executor mExecutor;
    private final CameraDevice mCameraDevice;
    private CameraDevice mCameraDevice;
    private final Map<String, CameraMetadataNative> mCharacteristicsMap;
    private final long mExtensionClientId;
    private final Handler mHandler;
    private final HandlerThread mHandlerThread;
    private final CameraExtensionSession.StateCallback mCallbacks;
    private final IAdvancedExtenderImpl mAdvancedExtender;
    private IAdvancedExtenderImpl mAdvancedExtender;
    // maps registered camera surfaces to extension output configs
    private final HashMap<Surface, CameraOutputConfig> mCameraConfigMap = new HashMap<>();
    // maps camera extension output ids to camera registered image readers
    private final HashMap<Integer, ImageReader> mReaderMap = new HashMap<>();
    private final RequestProcessor mRequestProcessor = new RequestProcessor();
    private RequestProcessor mRequestProcessor = new RequestProcessor();
    private final int mSessionId;

    private Surface mClientRepeatingRequestSurface;
@@ -100,7 +100,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
    private final ExtensionSessionStatsAggregator mStatsAggregator;

    private boolean mInitialized;

    private boolean mSessionClosed;

    // Lock to synchronize cross-thread access to device public interface
    final Object mInterfaceLock;
@@ -237,6 +237,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
        mHandlerThread.start();
        mHandler = new Handler(mHandlerThread.getLooper());
        mInitialized = false;
        mSessionClosed = false;
        mInitializeHandler = new InitializeSessionHandler();
        mSessionId = sessionId;
        mInterfaceLock = cameraDevice.mInterfaceLock;
@@ -424,7 +425,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
                mSessionProcessor.setParameters(request);

                seqId = mSessionProcessor.startRepeating(new RequestCallbackHandler(request,
                        executor, listener));
                        executor, listener, mCameraDevice.getId()));
            } catch (RemoteException e) {
                throw new CameraAccessException(CameraAccessException.CAMERA_ERROR,
                        "Failed to enable repeating request, extension service failed to respond!");
@@ -452,7 +453,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
                    mSessionProcessor.setParameters(request);

                    seqId = mSessionProcessor.startCapture(new RequestCallbackHandler(request,
                            executor, listener), isPostviewRequested);
                            executor, listener, mCameraDevice.getId()), isPostviewRequested);
                } catch (RemoteException e) {
                    throw new CameraAccessException(CameraAccessException.CAMERA_ERROR, "Failed " +
                            " to submit capture request, extension service failed to respond!");
@@ -460,8 +461,8 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
            } else if ((mClientRepeatingRequestSurface != null) &&
                    request.containsTarget(mClientRepeatingRequestSurface)) {
                try {
                    seqId = mSessionProcessor.startTrigger(request,
                            new RequestCallbackHandler(request, executor, listener));
                    seqId = mSessionProcessor.startTrigger(request, new RequestCallbackHandler(
                            request, executor, listener, mCameraDevice.getId()));
                } catch (RemoteException e) {
                    throw new CameraAccessException(CameraAccessException.CAMERA_ERROR, "Failed " +
                            " to submit trigger request, extension service failed to respond!");
@@ -528,6 +529,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
                    mCaptureSession.stopRepeating();
                    mSessionProcessor.stopRepeating();
                    mSessionProcessor.onCaptureSessionEnd();
                    mSessionClosed = true;
                } catch (RemoteException e) {
                    Log.e(TAG, "Failed to stop the repeating request or end the session,"
                            + " , extension service does not respond!") ;
@@ -560,6 +562,9 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes

            if (mSessionProcessor != null) {
                try {
                    if (!mSessionClosed) {
                        mSessionProcessor.onCaptureSessionEnd();
                    }
                    mSessionProcessor.deInitSession();
                } catch (RemoteException e) {
                    Log.e(TAG, "Failed to de-initialize session processor, extension service"
@@ -584,6 +589,10 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes

            mClientRepeatingRequestSurface = null;
            mClientCaptureSurface = null;
            mCaptureSession = null;
            mRequestProcessor = null;
            mCameraDevice = null;
            mAdvancedExtender = null;
        }

        if (notifyClose && !skipCloseNotification) {
@@ -706,13 +715,16 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
        private final CaptureRequest mClientRequest;
        private final Executor mClientExecutor;
        private final ExtensionCaptureCallback mClientCallbacks;
        private final String mCameraId;

        private RequestCallbackHandler(@NonNull CaptureRequest clientRequest,
                @NonNull Executor clientExecutor,
                @NonNull ExtensionCaptureCallback clientCallbacks) {
                @NonNull ExtensionCaptureCallback clientCallbacks,
                @NonNull String cameraId) {
            mClientRequest = clientRequest;
            mClientExecutor = clientExecutor;
            mClientCallbacks = clientCallbacks;
            mCameraId = cameraId;
        }

        @Override
@@ -784,7 +796,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
            }

            result.set(CaptureResult.SENSOR_TIMESTAMP, timestamp);
            TotalCaptureResult totalResult = new TotalCaptureResult(mCameraDevice.getId(), result,
            TotalCaptureResult totalResult = new TotalCaptureResult(mCameraId, result,
                    mClientRequest, requestId, timestamp, new ArrayList<>(), mSessionId,
                    new PhysicalCaptureResultInfo[0]);
            final long ident = Binder.clearCallingIdentity();
@@ -1036,6 +1048,11 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
        public int submitBurst(List<Request> requests, IRequestCallback callback) {
            int seqId = -1;
            try {
                synchronized (mInterfaceLock) {
                    if (!mInitialized) {
                        return seqId;
                    }

                    CaptureCallbackHandler captureCallback = new CaptureCallbackHandler(callback);
                    ArrayList<CaptureRequest> captureRequests = new ArrayList<>();
                    for (Request request : requests) {
@@ -1044,6 +1061,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
                    }
                    seqId = mCaptureSession.captureBurstRequests(captureRequests,
                            new CameraExtensionUtils.HandlerExecutor(mHandler), captureCallback);
                }
            } catch (CameraAccessException e) {
                Log.e(TAG, "Failed to submit capture requests!");
            } catch (IllegalStateException e) {
@@ -1057,11 +1075,17 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
        public int setRepeating(Request request, IRequestCallback callback) {
            int seqId = -1;
            try {
                synchronized (mInterfaceLock) {
                    if (!mInitialized) {
                        return seqId;
                    }

                    CaptureRequest repeatingRequest = initializeCaptureRequest(mCameraDevice,
                            request, mCameraConfigMap);
                    CaptureCallbackHandler captureCallback = new CaptureCallbackHandler(callback);
                    seqId = mCaptureSession.setSingleRepeatingRequest(repeatingRequest,
                            new CameraExtensionUtils.HandlerExecutor(mHandler), captureCallback);
                }
            } catch (CameraAccessException e) {
                Log.e(TAG, "Failed to enable repeating request!");
            } catch (IllegalStateException e) {
@@ -1074,7 +1098,13 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
        @Override
        public void abortCaptures() {
            try {
                synchronized (mInterfaceLock) {
                    if (!mInitialized) {
                        return;
                    }

                    mCaptureSession.abortCaptures();
                }
            } catch (CameraAccessException e) {
                Log.e(TAG, "Failed during capture abort!");
            } catch (IllegalStateException e) {
@@ -1085,7 +1115,13 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
        @Override
        public void stopRepeating() {
            try {
                synchronized (mInterfaceLock) {
                    if (!mInitialized) {
                        return;
                    }

                    mCaptureSession.stopRepeating();
                }
            } catch (CameraAccessException e) {
                Log.e(TAG, "Failed during repeating capture stop!");
            } catch (IllegalStateException e) {
+11 −12
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ public class GraphicsEnvironment {

    private int mAngleOptInIndex = -1;
    private boolean mEnabledByGameMode = false;
    private boolean mShouldUseAngle = false;

    /**
     * Set up GraphicsEnvironment
@@ -141,19 +142,16 @@ public class GraphicsEnvironment {

        // Setup ANGLE and pass down ANGLE details to the C++ code
        Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "setupAngle");
        boolean useAngle = false;
        if (setupAngle(context, coreSettings, pm, packageName)) {
            if (shouldUseAngle(context, coreSettings, packageName)) {
                useAngle = true;
            mShouldUseAngle = true;
            setGpuStats(ANGLE_DRIVER_NAME, ANGLE_DRIVER_VERSION_NAME, ANGLE_DRIVER_VERSION_CODE,
                    0, packageName, getVulkanVersion(pm));
        }
        }
        Trace.traceEnd(Trace.TRACE_TAG_GRAPHICS);

        Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "chooseDriver");
        if (!chooseDriver(context, coreSettings, pm, packageName, appInfoWithMetaData)) {
            if (!useAngle) {
            if (!mShouldUseAngle) {
                setGpuStats(SYSTEM_DRIVER_NAME, SYSTEM_DRIVER_VERSION_NAME,
                        SYSTEM_DRIVER_VERSION_CODE,
                        SystemProperties.getLong(PROPERTY_GFX_DRIVER_BUILD_TIME, 0),
@@ -636,7 +634,10 @@ public class GraphicsEnvironment {
    }

    /**
     * Show the ANGLE in Use Dialog Box
     * Show the ANGLE in use dialog box.
     * The ANGLE in use dialog box will show up as long as the application
     * should use ANGLE. It does not mean the application has successfully
     * loaded ANGLE because this check happens before the loading completes.
     * @param context
     */
    public void showAngleInUseDialogBox(Context context) {
@@ -644,8 +645,7 @@ public class GraphicsEnvironment {
            return;
        }

        final String packageName = context.getPackageName();
        if (!getShouldUseAngle(packageName)) {
        if (!mShouldUseAngle) {
            return;
        }

@@ -890,9 +890,8 @@ public class GraphicsEnvironment {
    private static native void setDriverPathAndSphalLibraries(String path, String sphalLibraries);
    private static native void setGpuStats(String driverPackageName, String driverVersionName,
            long driverVersionCode, long driverBuildTime, String appPackageName, int vulkanVersion);
    private static native void setAngleInfo(String path, String appPackage,
    private static native void setAngleInfo(String path, String packageName,
            String devOptIn, String[] features);
    private static native boolean getShouldUseAngle(String packageName);
    private static native boolean setInjectLayersPrSetDumpable();
    private static native void nativeToggleAngleAsSystemDriver(boolean enabled);

Loading