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

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

Snap for 7629638 from 57244b6e to sc-qpr1-release

Change-Id: I0fd909645b87b0246f1047c4e96a71d829a50526
parents c359d54b 57244b6e
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ public class FullBackup {
        ConfigSection.CLOUD_BACKUP,
        ConfigSection.DEVICE_TRANSFER
    })
    private @interface ConfigSection {
    @interface ConfigSection {
        String CLOUD_BACKUP = "cloud-backup";
        String DEVICE_TRANSFER = "device-transfer";
    }
@@ -528,7 +528,8 @@ public class FullBackup {
            return mExcludes;
        }

        private synchronized int getRequiredTransportFlags()
        @VisibleForTesting
        public synchronized int getRequiredTransportFlags()
                throws IOException, XmlPullParserException {
            if (mRequiredTransportFlags == null) {
                maybeParseBackupSchemeLocked();
@@ -587,11 +588,13 @@ public class FullBackup {
            if (mDataExtractionRules != 0) {
                // New config is present. Use it if it has configuration for this operation
                // type.
                boolean isSectionPresent;
                try (XmlResourceParser parser = getParserForResource(mDataExtractionRules)) {
                    parseNewBackupSchemeFromXmlLocked(parser, configSection, mExcludes, mIncludes);
                    isSectionPresent = parseNewBackupSchemeFromXmlLocked(parser, configSection,
                            mExcludes, mIncludes);
                }
                if (!mExcludes.isEmpty() || !mIncludes.isEmpty()) {
                    // Found configuration in the new config, we will use it.
                if (isSectionPresent) {
                    // Found the relevant section in the new config, we will use it.
                    mIsUsingNewScheme = true;
                    return;
                }
@@ -630,24 +633,31 @@ public class FullBackup {
                    .getXml(resourceId);
        }

        private void parseNewBackupSchemeFromXmlLocked(XmlPullParser parser,
        @VisibleForTesting
        public boolean parseNewBackupSchemeFromXmlLocked(XmlPullParser parser,
                @ConfigSection  String configSection,
                Set<PathWithRequiredFlags> excludes,
                Map<String, Set<PathWithRequiredFlags>> includes)
                throws IOException, XmlPullParserException {
            verifyTopLevelTag(parser, "data-extraction-rules");

            boolean isSectionPresent = false;

            int event;
            while ((event = parser.next()) != XmlPullParser.END_DOCUMENT) {
                if (event != XmlPullParser.START_TAG || !configSection.equals(parser.getName())) {
                    continue;
                }

                isSectionPresent = true;

                parseRequiredTransportFlags(parser, configSection);
                parseRules(parser, excludes, includes, Optional.of(0), configSection);
            }

            logParsingResults(excludes, includes);

            return isSectionPresent;
        }

        private void parseRequiredTransportFlags(XmlPullParser parser,
+14 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package android.appwidget;
import android.annotation.Nullable;
import android.util.ArraySet;

import java.util.Set;

/**
 * App widget manager local system service interface.
 *
@@ -42,4 +44,16 @@ public abstract class AppWidgetManagerInternal {
     * @param userId The user that is being unlocked.
     */
    public abstract void unlockUser(int userId);

    /**
     * Updates all widgets, applying changes to Runtime Resource Overlay affecting the specified
     * target packages.
     *
     * @param packageNames The names of all target packages for which an overlay was modified
     * @param userId The user for which overlay modifications occurred.
     * @param updateFrameworkRes Whether or not an overlay affected the values of framework
     *                           resources.
     */
    public abstract void applyResourceOverlaysToWidgets(Set<String> packageNames, int userId,
            boolean updateFrameworkRes);
}
+2 −0
Original line number Diff line number Diff line
@@ -52,4 +52,6 @@ interface ISensorPrivacyManager {
    void addUserGlobalIndividualSensorPrivacyListener(int sensor, in ISensorPrivacyListener listener);

    void removeUserGlobalIndividualSensorPrivacyListener(int sensor, in ISensorPrivacyListener listener);

    void showSensorUseDialog(int sensor);
}
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.UserHandle;
import android.service.SensorPrivacyIndividualEnabledSensorProto;
import android.service.SensorPrivacyToggleSourceProto;
import android.util.ArrayMap;
import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;

@@ -48,6 +49,8 @@ import java.util.concurrent.Executor;
@SystemService(Context.SENSOR_PRIVACY_SERVICE)
public final class SensorPrivacyManager {

    private static final String LOG_TAG = SensorPrivacyManager.class.getSimpleName();

    /**
     * Unique Id of this manager to identify to the service
     * @hide
@@ -504,6 +507,25 @@ public final class SensorPrivacyManager {
        }
    }

    /**
     * If sensor privacy for the provided sensor is enabled then this call will show the user the
     * dialog which is shown when an application attempts to use that sensor. If privacy isn't
     * enabled then this does nothing.
     *
     * This call can only be made by the system uid.
     *
     * @throws SecurityException when called by someone other than system uid.
     *
     * @hide
     */
    public void showSensorUseDialog(int sensor) {
        try {
            mService.showSensorUseDialog(sensor);
        } catch (RemoteException e) {
            Log.e(LOG_TAG, "Received exception while trying to show sensor use dialog", e);
        }
    }

    /**
     * A class implementing this interface can register with the {@link
     * android.hardware.SensorPrivacyManager} to receive notification when the all-sensor privacy
+17 −18
Original line number Diff line number Diff line
@@ -446,16 +446,12 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
        }
    }

    @Override
    protected void finalize() throws Throwable {
        if (mHandlerThread != null) {
            mHandlerThread.quitSafely();
        }
        super.finalize();
    }
    public void release(boolean skipCloseNotification) {
        boolean notifyClose = false;

    public void release() {
        synchronized (mInterfaceLock) {
            mHandlerThread.quitSafely();

            if (mSessionProcessor != null) {
                try {
                    mSessionProcessor.deInitSession();
@@ -469,6 +465,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
            if (mExtensionClientId >= 0) {
                CameraExtensionCharacteristics.unregisterClient(mExtensionClientId);
                if (mInitialized) {
                    notifyClose = true;
                    CameraExtensionCharacteristics.releaseSession();
                }
            }
@@ -482,6 +479,16 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
            mClientRepeatingRequestSurface = null;
            mClientCaptureSurface = null;
        }

        if (notifyClose && !skipCloseNotification) {
            final long ident = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(() -> mCallbacks.onClosed(
                        CameraAdvancedExtensionSessionImpl.this));
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }
    }

    private void notifyConfigurationFailure() {
@@ -491,7 +498,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
            }
        }

        release();
        release(true /*skipCloseNotification*/);

        final long ident = Binder.clearCallingIdentity();
        try {
@@ -507,15 +514,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes
            android.hardware.camera2.CameraCaptureSession.StateCallback {
        @Override
        public void onClosed(@NonNull CameraCaptureSession session) {
            release();

            final long ident = Binder.clearCallingIdentity();
            try {
                mExecutor.execute(() -> mCallbacks.onClosed(
                       CameraAdvancedExtensionSessionImpl.this));
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
            release(false /*skipCloseNotification*/);
        }

        @Override
Loading