Loading core/java/android/app/AppOpsManager.java +5 −4 Original line number Diff line number Diff line Loading @@ -8367,13 +8367,13 @@ public class AppOpsManager { } else { opCodes = null; } final List<AppOpsManager.PackageOps> result; try { result = mService.getPackagesForOpsForDevice(opCodes, persistentDeviceId); ParceledListSlice<PackageOps> packageOps = mService.getPackagesForOpsForDevice(opCodes, persistentDeviceId); return packageOps == null ? Collections.emptyList() : packageOps.getList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } return (result != null) ? result : Collections.emptyList(); } /** Loading @@ -8392,8 +8392,9 @@ public class AppOpsManager { @UnsupportedAppUsage public List<AppOpsManager.PackageOps> getPackagesForOps(int[] ops) { try { return mService.getPackagesForOpsForDevice(ops, ParceledListSlice<PackageOps> packageOps = mService.getPackagesForOpsForDevice(ops, VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT); return packageOps == null ? null : packageOps.getList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/app/INotificationManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -178,7 +178,6 @@ interface INotificationManager void setInterruptionFilter(String pkg, int interruptionFilter, boolean fromUser); NotificationChannel createConversationNotificationChannelForPackageFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, String parentChannelId, String conversationId); void updateNotificationChannelGroupFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannelGroup group); void updateNotificationChannelFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannel channel); ParceledListSlice getNotificationChannelsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user); ParceledListSlice getNotificationChannelGroupsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user); Loading core/java/android/companion/AssociationRequest.java +10 −5 Original line number Diff line number Diff line Loading @@ -311,6 +311,7 @@ public final class AssociationRequest implements Parcelable { boolean forceConfirmation, boolean skipRoleGrant, @Nullable Icon deviceIcon) { validateDisplayName(displayName); mSingleDevice = singleDevice; mDeviceFilters = requireNonNull(deviceFilters); mDeviceProfile = deviceProfile; Loading Loading @@ -418,6 +419,7 @@ public final class AssociationRequest implements Parcelable { /** @hide */ public void setDisplayName(CharSequence displayName) { validateDisplayName(displayName); mDisplayName = displayName; } Loading Loading @@ -503,11 +505,7 @@ public final class AssociationRequest implements Parcelable { public Builder setDisplayName(@NonNull CharSequence displayName) { checkNotUsed(); mDisplayName = requireNonNull(displayName); if (displayName.length() > DISPLAY_NAME_LENGTH_LIMIT) { throw new IllegalArgumentException("Length of the display name must be at most " + DISPLAY_NAME_LENGTH_LIMIT + " characters"); } validateDisplayName(displayName); return this; } Loading Loading @@ -815,4 +813,11 @@ public final class AssociationRequest implements Parcelable { return new AssociationRequest(in); } }; private static void validateDisplayName(@Nullable CharSequence displayName) { if (displayName != null && displayName.length() > DISPLAY_NAME_LENGTH_LIMIT) { throw new IllegalArgumentException("Length of the display name must be at most " + DISPLAY_NAME_LENGTH_LIMIT + " characters"); } } } core/java/android/content/ContentProvider.java +25 −4 Original line number Diff line number Diff line Loading @@ -590,13 +590,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall throws FileNotFoundException { uri = validateIncomingUri(uri); uri = maybeGetUriWithoutUserId(uri); enforceFilePermission(attributionSource, uri, mode); final String updatedMode = validateFileMode(mode); enforceFilePermission(attributionSource, uri, updatedMode); traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "openFile: ", uri.getAuthority()); final AttributionSource original = setCallingAttributionSource( attributionSource); try { return mInterface.openFile( uri, mode, CancellationSignal.fromTransport(cancellationSignal)); uri, updatedMode, CancellationSignal.fromTransport(cancellationSignal)); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } finally { Loading @@ -611,13 +612,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall throws FileNotFoundException { uri = validateIncomingUri(uri); uri = maybeGetUriWithoutUserId(uri); enforceFilePermission(attributionSource, uri, mode); final String updatedMode = validateFileMode(mode); enforceFilePermission(attributionSource, uri, updatedMode); traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "openAssetFile: ", uri.getAuthority()); final AttributionSource original = setCallingAttributionSource( attributionSource); try { return mInterface.openAssetFile( uri, mode, CancellationSignal.fromTransport(cancellationSignal)); uri, updatedMode, CancellationSignal.fromTransport(cancellationSignal)); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } finally { Loading Loading @@ -782,6 +784,25 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall } } private String validateFileMode(String mode) { // We currently only support the following modes: r, w, wt, wa, rw, rwt // Note: ideally, we should check against the allowed modes and throw a // SecurityException if the mode doesn't match any of them but to avoid app compat // issues, we're silently dropping bits which allow modifying files when the write bit // is not specified. if (mode != null && mode.indexOf('w') == -1) { // Don't allow truncation without write if (mode.indexOf('t') != -1) { mode = mode.replace("t", ""); } // Don't allow appending without write if (mode.indexOf('a') != -1) { mode = mode.replace("a", ""); } } return mode; } @Override public int checkUriPermission(@NonNull AttributionSource attributionSource, Uri uri, int uid, int modeFlags) { Loading core/java/android/content/res/Resources.java +108 −104 Original line number Diff line number Diff line Loading @@ -2614,12 +2614,16 @@ public class Resources { } /** * Called by ConfigurationBoundResourceCacheTest. * Called by ConfigurationBoundResourceCacheTest. Applies the new configuration, returning a * bitmask of the changes between the old and new configurations. * * @param config the new configuration * @return bitmask of config changes * @hide */ @VisibleForTesting public int calcConfigChanges(Configuration config) { return mResourcesImpl.calcConfigChanges(config); public int applyConfigChanges(Configuration config) { return mResourcesImpl.applyConfigChanges(config); } /** Loading Loading
core/java/android/app/AppOpsManager.java +5 −4 Original line number Diff line number Diff line Loading @@ -8367,13 +8367,13 @@ public class AppOpsManager { } else { opCodes = null; } final List<AppOpsManager.PackageOps> result; try { result = mService.getPackagesForOpsForDevice(opCodes, persistentDeviceId); ParceledListSlice<PackageOps> packageOps = mService.getPackagesForOpsForDevice(opCodes, persistentDeviceId); return packageOps == null ? Collections.emptyList() : packageOps.getList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } return (result != null) ? result : Collections.emptyList(); } /** Loading @@ -8392,8 +8392,9 @@ public class AppOpsManager { @UnsupportedAppUsage public List<AppOpsManager.PackageOps> getPackagesForOps(int[] ops) { try { return mService.getPackagesForOpsForDevice(ops, ParceledListSlice<PackageOps> packageOps = mService.getPackagesForOpsForDevice(ops, VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT); return packageOps == null ? null : packageOps.getList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/app/INotificationManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -178,7 +178,6 @@ interface INotificationManager void setInterruptionFilter(String pkg, int interruptionFilter, boolean fromUser); NotificationChannel createConversationNotificationChannelForPackageFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, String parentChannelId, String conversationId); void updateNotificationChannelGroupFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannelGroup group); void updateNotificationChannelFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannel channel); ParceledListSlice getNotificationChannelsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user); ParceledListSlice getNotificationChannelGroupsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user); Loading
core/java/android/companion/AssociationRequest.java +10 −5 Original line number Diff line number Diff line Loading @@ -311,6 +311,7 @@ public final class AssociationRequest implements Parcelable { boolean forceConfirmation, boolean skipRoleGrant, @Nullable Icon deviceIcon) { validateDisplayName(displayName); mSingleDevice = singleDevice; mDeviceFilters = requireNonNull(deviceFilters); mDeviceProfile = deviceProfile; Loading Loading @@ -418,6 +419,7 @@ public final class AssociationRequest implements Parcelable { /** @hide */ public void setDisplayName(CharSequence displayName) { validateDisplayName(displayName); mDisplayName = displayName; } Loading Loading @@ -503,11 +505,7 @@ public final class AssociationRequest implements Parcelable { public Builder setDisplayName(@NonNull CharSequence displayName) { checkNotUsed(); mDisplayName = requireNonNull(displayName); if (displayName.length() > DISPLAY_NAME_LENGTH_LIMIT) { throw new IllegalArgumentException("Length of the display name must be at most " + DISPLAY_NAME_LENGTH_LIMIT + " characters"); } validateDisplayName(displayName); return this; } Loading Loading @@ -815,4 +813,11 @@ public final class AssociationRequest implements Parcelable { return new AssociationRequest(in); } }; private static void validateDisplayName(@Nullable CharSequence displayName) { if (displayName != null && displayName.length() > DISPLAY_NAME_LENGTH_LIMIT) { throw new IllegalArgumentException("Length of the display name must be at most " + DISPLAY_NAME_LENGTH_LIMIT + " characters"); } } }
core/java/android/content/ContentProvider.java +25 −4 Original line number Diff line number Diff line Loading @@ -590,13 +590,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall throws FileNotFoundException { uri = validateIncomingUri(uri); uri = maybeGetUriWithoutUserId(uri); enforceFilePermission(attributionSource, uri, mode); final String updatedMode = validateFileMode(mode); enforceFilePermission(attributionSource, uri, updatedMode); traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "openFile: ", uri.getAuthority()); final AttributionSource original = setCallingAttributionSource( attributionSource); try { return mInterface.openFile( uri, mode, CancellationSignal.fromTransport(cancellationSignal)); uri, updatedMode, CancellationSignal.fromTransport(cancellationSignal)); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } finally { Loading @@ -611,13 +612,14 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall throws FileNotFoundException { uri = validateIncomingUri(uri); uri = maybeGetUriWithoutUserId(uri); enforceFilePermission(attributionSource, uri, mode); final String updatedMode = validateFileMode(mode); enforceFilePermission(attributionSource, uri, updatedMode); traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "openAssetFile: ", uri.getAuthority()); final AttributionSource original = setCallingAttributionSource( attributionSource); try { return mInterface.openAssetFile( uri, mode, CancellationSignal.fromTransport(cancellationSignal)); uri, updatedMode, CancellationSignal.fromTransport(cancellationSignal)); } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } finally { Loading Loading @@ -782,6 +784,25 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall } } private String validateFileMode(String mode) { // We currently only support the following modes: r, w, wt, wa, rw, rwt // Note: ideally, we should check against the allowed modes and throw a // SecurityException if the mode doesn't match any of them but to avoid app compat // issues, we're silently dropping bits which allow modifying files when the write bit // is not specified. if (mode != null && mode.indexOf('w') == -1) { // Don't allow truncation without write if (mode.indexOf('t') != -1) { mode = mode.replace("t", ""); } // Don't allow appending without write if (mode.indexOf('a') != -1) { mode = mode.replace("a", ""); } } return mode; } @Override public int checkUriPermission(@NonNull AttributionSource attributionSource, Uri uri, int uid, int modeFlags) { Loading
core/java/android/content/res/Resources.java +108 −104 Original line number Diff line number Diff line Loading @@ -2614,12 +2614,16 @@ public class Resources { } /** * Called by ConfigurationBoundResourceCacheTest. * Called by ConfigurationBoundResourceCacheTest. Applies the new configuration, returning a * bitmask of the changes between the old and new configurations. * * @param config the new configuration * @return bitmask of config changes * @hide */ @VisibleForTesting public int calcConfigChanges(Configuration config) { return mResourcesImpl.calcConfigChanges(config); public int applyConfigChanges(Configuration config) { return mResourcesImpl.applyConfigChanges(config); } /** Loading