Loading core/java/android/app/ApplicationPackageManager.java +21 −7 Original line number Diff line number Diff line Loading @@ -1461,22 +1461,36 @@ public class ApplicationPackageManager extends PackageManager { @Override public ResolveInfo resolveActivity(Intent intent, ResolveInfoFlags flags) { return resolveActivityAsUser(intent, flags, getUserId()); return resolveActivityAsUser(intent, /* resolvedType= */ null, flags, getUserId()); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId) { return resolveActivityAsUser(intent, ResolveInfoFlags.of(flags), userId); return resolveActivityAsUser(intent, /* resolvedType= */ null, ResolveInfoFlags.of(flags), userId); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, ResolveInfoFlags flags, int userId) { return resolveActivityAsUser(intent, /* resolvedType= */ null, flags, userId); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, String resolvedType, int flags, int userId) { return resolveActivityAsUser(intent, resolvedType, ResolveInfoFlags.of(flags), userId); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, String resolvedType, ResolveInfoFlags flags, int userId) { try { return mPM.resolveIntent( intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), updateFlagsForComponent(flags.getValue(), userId, intent), userId); return mPM.resolveIntent(intent, resolvedType == null ? intent.resolveTypeIfNeeded(mContext.getContentResolver()) : resolvedType, updateFlagsForComponent(flags.getValue(), userId, intent), userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/app/INotificationManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,6 @@ interface INotificationManager void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim); void setInterruptionFilter(String pkg, int interruptionFilter, boolean fromUser); 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/app/KeyguardManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,15 @@ public class KeyguardManager { */ public static final String EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS = "check_dpm"; /** * When switching to a secure user, system server will expect a callback when the UI has * completed the switch. * * @hide */ public static final String LOCK_ON_USER_SWITCH_CALLBACK = "onSwitchCallback"; /** * * Password lock type, see {@link #setLock} Loading core/java/android/companion/AssociationRequest.java +10 −4 Original line number Diff line number Diff line Loading @@ -261,6 +261,7 @@ public final class AssociationRequest implements Parcelable { @Nullable CharSequence displayName, boolean selfManaged, boolean forceConfirmation) { validateDisplayName(displayName); mSingleDevice = singleDevice; mDeviceFilters = requireNonNull(deviceFilters); mDeviceProfile = deviceProfile; Loading Loading @@ -342,6 +343,7 @@ public final class AssociationRequest implements Parcelable { /** @hide */ public void setDisplayName(CharSequence displayName) { validateDisplayName(displayName); mDisplayName = displayName; } Loading Loading @@ -421,10 +423,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 @@ -672,4 +671,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 @@ -585,13 +585,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 @@ -606,13 +607,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 @@ -777,6 +779,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 Loading
core/java/android/app/ApplicationPackageManager.java +21 −7 Original line number Diff line number Diff line Loading @@ -1461,22 +1461,36 @@ public class ApplicationPackageManager extends PackageManager { @Override public ResolveInfo resolveActivity(Intent intent, ResolveInfoFlags flags) { return resolveActivityAsUser(intent, flags, getUserId()); return resolveActivityAsUser(intent, /* resolvedType= */ null, flags, getUserId()); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId) { return resolveActivityAsUser(intent, ResolveInfoFlags.of(flags), userId); return resolveActivityAsUser(intent, /* resolvedType= */ null, ResolveInfoFlags.of(flags), userId); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, ResolveInfoFlags flags, int userId) { return resolveActivityAsUser(intent, /* resolvedType= */ null, flags, userId); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, String resolvedType, int flags, int userId) { return resolveActivityAsUser(intent, resolvedType, ResolveInfoFlags.of(flags), userId); } @Override public ResolveInfo resolveActivityAsUser(Intent intent, String resolvedType, ResolveInfoFlags flags, int userId) { try { return mPM.resolveIntent( intent, intent.resolveTypeIfNeeded(mContext.getContentResolver()), updateFlagsForComponent(flags.getValue(), userId, intent), userId); return mPM.resolveIntent(intent, resolvedType == null ? intent.resolveTypeIfNeeded(mContext.getContentResolver()) : resolvedType, updateFlagsForComponent(flags.getValue(), userId, intent), userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/app/INotificationManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,6 @@ interface INotificationManager void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim); void setInterruptionFilter(String pkg, int interruptionFilter, boolean fromUser); 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/app/KeyguardManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -202,6 +202,15 @@ public class KeyguardManager { */ public static final String EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS = "check_dpm"; /** * When switching to a secure user, system server will expect a callback when the UI has * completed the switch. * * @hide */ public static final String LOCK_ON_USER_SWITCH_CALLBACK = "onSwitchCallback"; /** * * Password lock type, see {@link #setLock} Loading
core/java/android/companion/AssociationRequest.java +10 −4 Original line number Diff line number Diff line Loading @@ -261,6 +261,7 @@ public final class AssociationRequest implements Parcelable { @Nullable CharSequence displayName, boolean selfManaged, boolean forceConfirmation) { validateDisplayName(displayName); mSingleDevice = singleDevice; mDeviceFilters = requireNonNull(deviceFilters); mDeviceProfile = deviceProfile; Loading Loading @@ -342,6 +343,7 @@ public final class AssociationRequest implements Parcelable { /** @hide */ public void setDisplayName(CharSequence displayName) { validateDisplayName(displayName); mDisplayName = displayName; } Loading Loading @@ -421,10 +423,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 @@ -672,4 +671,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 @@ -585,13 +585,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 @@ -606,13 +607,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 @@ -777,6 +779,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