Loading core/java/android/app/backup/FullBackup.java +16 −6 Original line number Diff line number Diff line Loading @@ -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"; } Loading Loading @@ -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(); Loading Loading @@ -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; } Loading Loading @@ -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, Loading core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java +17 −18 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -469,6 +465,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes if (mExtensionClientId >= 0) { CameraExtensionCharacteristics.unregisterClient(mExtensionClientId); if (mInitialized) { notifyClose = true; CameraExtensionCharacteristics.releaseSession(); } } Loading @@ -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() { Loading @@ -491,7 +498,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes } } release(); release(true /*skipCloseNotification*/); final long ident = Binder.clearCallingIdentity(); try { Loading @@ -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 core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -697,12 +697,12 @@ public class CameraDeviceImpl extends CameraDevice } if (mCurrentExtensionSession != null) { mCurrentExtensionSession.release(); mCurrentExtensionSession.release(false /*skipCloseNotification*/); mCurrentExtensionSession = null; } if (mCurrentAdvancedExtensionSession != null) { mCurrentAdvancedExtensionSession.release(); mCurrentAdvancedExtensionSession.release(false /*skipCloseNotification*/); mCurrentAdvancedExtensionSession = null; } Loading Loading @@ -1352,12 +1352,12 @@ public class CameraDeviceImpl extends CameraDevice } if (mCurrentExtensionSession != null) { mCurrentExtensionSession.release(); mCurrentExtensionSession.release(true /*skipCloseNotification*/); mCurrentExtensionSession = null; } if (mCurrentAdvancedExtensionSession != null) { mCurrentAdvancedExtensionSession.release(); mCurrentAdvancedExtensionSession.release(true /*skipCloseNotification*/); mCurrentAdvancedExtensionSession = null; } Loading core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java +16 −18 Original line number Diff line number Diff line Loading @@ -630,18 +630,13 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { new CameraExtensionUtils.HandlerExecutor(mHandler), requestHandler); } @Override protected void finalize() throws Throwable { if (mHandlerThread != null) { mHandlerThread.quitSafely(); } super.finalize(); } /** @hide */ public void release() { public void release(boolean skipCloseNotification) { boolean notifyClose = false; synchronized (mInterfaceLock) { mInternalRepeatingRequestEnabled = false; mHandlerThread.quitSafely(); try { mPreviewExtender.onDeInit(); Loading @@ -654,6 +649,7 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { if (mExtensionClientId >= 0) { CameraExtensionCharacteristics.unregisterClient(mExtensionClientId); if (mInitialized) { notifyClose = true; CameraExtensionCharacteristics.releaseSession(); } } Loading Loading @@ -704,6 +700,15 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { mCameraRepeatingSurface = mClientRepeatingRequestSurface = null; mCameraBurstSurface = mClientCaptureSurface = null; } if (notifyClose && !skipCloseNotification) { final long ident = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> mCallbacks.onClosed(CameraExtensionSessionImpl.this)); } finally { Binder.restoreCallingIdentity(ident); } } } private void notifyConfigurationFailure() { Loading @@ -713,7 +718,7 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { } } release(); release(true /*skipCloseNotification*/); final long ident = Binder.clearCallingIdentity(); try { Loading Loading @@ -745,14 +750,7 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { android.hardware.camera2.CameraCaptureSession.StateCallback { @Override public void onClosed(@NonNull CameraCaptureSession session) { release(); final long ident = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> mCallbacks.onClosed(CameraExtensionSessionImpl.this)); } finally { Binder.restoreCallingIdentity(ident); } release(false /*skipCloseNotification*/); } @Override Loading core/java/android/service/voice/AlwaysOnHotwordDetector.java +3 −0 Original line number Diff line number Diff line Loading @@ -783,6 +783,9 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { * This may happen if another detector has been instantiated or the * {@link VoiceInteractionService} hosting this detector has been shut down. */ // TODO: Remove this RequiresPermission since it isn't actually enforced. Also fix the javadoc // about permissions enforcement (when it throws vs when it just returns false) for other // methods in this class. @RequiresPermission(allOf = {RECORD_AUDIO, CAPTURE_AUDIO_HOTWORD}) @Override public boolean stopRecognition() { Loading Loading
core/java/android/app/backup/FullBackup.java +16 −6 Original line number Diff line number Diff line Loading @@ -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"; } Loading Loading @@ -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(); Loading Loading @@ -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; } Loading Loading @@ -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, Loading
core/java/android/hardware/camera2/impl/CameraAdvancedExtensionSessionImpl.java +17 −18 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -469,6 +465,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes if (mExtensionClientId >= 0) { CameraExtensionCharacteristics.unregisterClient(mExtensionClientId); if (mInitialized) { notifyClose = true; CameraExtensionCharacteristics.releaseSession(); } } Loading @@ -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() { Loading @@ -491,7 +498,7 @@ public final class CameraAdvancedExtensionSessionImpl extends CameraExtensionSes } } release(); release(true /*skipCloseNotification*/); final long ident = Binder.clearCallingIdentity(); try { Loading @@ -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
core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +4 −4 Original line number Diff line number Diff line Loading @@ -697,12 +697,12 @@ public class CameraDeviceImpl extends CameraDevice } if (mCurrentExtensionSession != null) { mCurrentExtensionSession.release(); mCurrentExtensionSession.release(false /*skipCloseNotification*/); mCurrentExtensionSession = null; } if (mCurrentAdvancedExtensionSession != null) { mCurrentAdvancedExtensionSession.release(); mCurrentAdvancedExtensionSession.release(false /*skipCloseNotification*/); mCurrentAdvancedExtensionSession = null; } Loading Loading @@ -1352,12 +1352,12 @@ public class CameraDeviceImpl extends CameraDevice } if (mCurrentExtensionSession != null) { mCurrentExtensionSession.release(); mCurrentExtensionSession.release(true /*skipCloseNotification*/); mCurrentExtensionSession = null; } if (mCurrentAdvancedExtensionSession != null) { mCurrentAdvancedExtensionSession.release(); mCurrentAdvancedExtensionSession.release(true /*skipCloseNotification*/); mCurrentAdvancedExtensionSession = null; } Loading
core/java/android/hardware/camera2/impl/CameraExtensionSessionImpl.java +16 −18 Original line number Diff line number Diff line Loading @@ -630,18 +630,13 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { new CameraExtensionUtils.HandlerExecutor(mHandler), requestHandler); } @Override protected void finalize() throws Throwable { if (mHandlerThread != null) { mHandlerThread.quitSafely(); } super.finalize(); } /** @hide */ public void release() { public void release(boolean skipCloseNotification) { boolean notifyClose = false; synchronized (mInterfaceLock) { mInternalRepeatingRequestEnabled = false; mHandlerThread.quitSafely(); try { mPreviewExtender.onDeInit(); Loading @@ -654,6 +649,7 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { if (mExtensionClientId >= 0) { CameraExtensionCharacteristics.unregisterClient(mExtensionClientId); if (mInitialized) { notifyClose = true; CameraExtensionCharacteristics.releaseSession(); } } Loading Loading @@ -704,6 +700,15 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { mCameraRepeatingSurface = mClientRepeatingRequestSurface = null; mCameraBurstSurface = mClientCaptureSurface = null; } if (notifyClose && !skipCloseNotification) { final long ident = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> mCallbacks.onClosed(CameraExtensionSessionImpl.this)); } finally { Binder.restoreCallingIdentity(ident); } } } private void notifyConfigurationFailure() { Loading @@ -713,7 +718,7 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { } } release(); release(true /*skipCloseNotification*/); final long ident = Binder.clearCallingIdentity(); try { Loading Loading @@ -745,14 +750,7 @@ public final class CameraExtensionSessionImpl extends CameraExtensionSession { android.hardware.camera2.CameraCaptureSession.StateCallback { @Override public void onClosed(@NonNull CameraCaptureSession session) { release(); final long ident = Binder.clearCallingIdentity(); try { mExecutor.execute(() -> mCallbacks.onClosed(CameraExtensionSessionImpl.this)); } finally { Binder.restoreCallingIdentity(ident); } release(false /*skipCloseNotification*/); } @Override Loading
core/java/android/service/voice/AlwaysOnHotwordDetector.java +3 −0 Original line number Diff line number Diff line Loading @@ -783,6 +783,9 @@ public class AlwaysOnHotwordDetector extends AbstractHotwordDetector { * This may happen if another detector has been instantiated or the * {@link VoiceInteractionService} hosting this detector has been shut down. */ // TODO: Remove this RequiresPermission since it isn't actually enforced. Also fix the javadoc // about permissions enforcement (when it throws vs when it just returns false) for other // methods in this class. @RequiresPermission(allOf = {RECORD_AUDIO, CAPTURE_AUDIO_HOTWORD}) @Override public boolean stopRecognition() { Loading