Loading apex/appsearch/framework/java/external/android/app/appsearch/GenericDocument.java +0 −12 Original line number Original line Diff line number Diff line Loading @@ -51,9 +51,6 @@ import java.util.Set; public class GenericDocument { public class GenericDocument { private static final String TAG = "AppSearchGenericDocumen"; private static final String TAG = "AppSearchGenericDocumen"; /** The maximum {@link String#length} of a {@link String} field. */ private static final int MAX_STRING_LENGTH = 20_000; /** The maximum number of indexed properties a document can have. */ /** The maximum number of indexed properties a document can have. */ private static final int MAX_INDEXED_PROPERTIES = 16; private static final int MAX_INDEXED_PROPERTIES = 16; Loading Loading @@ -1286,15 +1283,6 @@ public class GenericDocument { for (int i = 0; i < values.length; i++) { for (int i = 0; i < values.length; i++) { if (values[i] == null) { if (values[i] == null) { throw new IllegalArgumentException("The String at " + i + " is null."); throw new IllegalArgumentException("The String at " + i + " is null."); } else if (values[i].length() > MAX_STRING_LENGTH) { throw new IllegalArgumentException( "The String at " + i + " length is: " + values[i].length() + ", which exceeds length limit: " + MAX_STRING_LENGTH + "."); } } } } mProperties.putStringArray(name, values); mProperties.putStringArray(name, values); Loading apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java +4 −22 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.server.appsearch; import static android.app.appsearch.AppSearchResult.throwableToFailedResult; import static android.app.appsearch.AppSearchResult.throwableToFailedResult; import static android.os.Process.INVALID_UID; import static android.os.Process.INVALID_UID; import android.Manifest; import android.annotation.ElapsedRealtimeLong; import android.annotation.ElapsedRealtimeLong; import android.annotation.NonNull; import android.annotation.NonNull; import android.app.appsearch.AppSearchBatchResult; import android.app.appsearch.AppSearchBatchResult; Loading Loading @@ -1354,43 +1353,26 @@ public class AppSearchManagerService extends SystemService { /** /** * Helper for dealing with incoming user arguments to system service calls. * Helper for dealing with incoming user arguments to system service calls. * * * <p>Takes care of checking permissions and converting USER_CURRENT to the actual current user. * * @param requestedUser The user which the caller is requesting to execute as. * @param requestedUser The user which the caller is requesting to execute as. * @param callingUid The actual uid of the caller as determined by Binder. * @param callingUid The actual uid of the caller as determined by Binder. * @return the user handle that the call should run as. Will always be a concrete user. * @return the user handle that the call should run as. Will always be a concrete user. */ */ @NonNull @NonNull private UserHandle handleIncomingUser(@NonNull UserHandle requestedUser, int callingUid) { private UserHandle handleIncomingUser(@NonNull UserHandle requestedUser, int callingUid) { int callingPid = Binder.getCallingPid(); UserHandle callingUser = UserHandle.getUserHandleForUid(callingUid); UserHandle callingUser = UserHandle.getUserHandleForUid(callingUid); if (callingUser.equals(requestedUser)) { if (callingUser.equals(requestedUser)) { return requestedUser; return requestedUser; } } // Duplicates UserController#ensureNotSpecialUser // Duplicates UserController#ensureNotSpecialUser if (requestedUser.getIdentifier() < 0) { if (requestedUser.getIdentifier() < 0) { throw new IllegalArgumentException( throw new IllegalArgumentException( "Call does not support special user " + requestedUser); "Call does not support special user " + requestedUser); } } boolean canInteractAcrossUsers = mContext.checkPermission( Manifest.permission.INTERACT_ACROSS_USERS, callingPid, callingUid) == PackageManager.PERMISSION_GRANTED; if (!canInteractAcrossUsers) { canInteractAcrossUsers = mContext.checkPermission( Manifest.permission.INTERACT_ACROSS_USERS_FULL, callingPid, callingUid) == PackageManager.PERMISSION_GRANTED; } if (canInteractAcrossUsers) { return requestedUser; } throw new SecurityException( throw new SecurityException( "Permission denied while calling from uid " + callingUid "Requested user, " + requestedUser + ", is not the same as the calling user, " + " with " + requestedUser + "; Need to run as either the calling user (" + callingUser + "."); + callingUser + "), or with one of the following permissions: " + Manifest.permission.INTERACT_ACROSS_USERS + " or " + Manifest.permission.INTERACT_ACROSS_USERS_FULL); } } /** /** Loading apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -4635,7 +4635,6 @@ public class AlarmManagerService extends SystemService { Slog.d(TAG, "Package " + packageName + " for user " + userId + " now in bucket " + Slog.d(TAG, "Package " + packageName + " for user " + userId + " now in bucket " + bucket); bucket); } } mHandler.removeMessages(AlarmHandler.APP_STANDBY_BUCKET_CHANGED); mHandler.obtainMessage(AlarmHandler.APP_STANDBY_BUCKET_CHANGED, userId, -1, packageName) mHandler.obtainMessage(AlarmHandler.APP_STANDBY_BUCKET_CHANGED, userId, -1, packageName) .sendToTarget(); .sendToTarget(); } } Loading core/java/android/app/AppOpsManagerInternal.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.app.AppOpsManager.AttributionFlags; import android.app.AppOpsManager.AttributionFlags; import android.content.AttributionSource; import android.content.AttributionSource; import android.os.IBinder; import android.os.IBinder; import android.os.UserHandle; import android.util.SparseArray; import android.util.SparseArray; import android.util.SparseIntArray; import android.util.SparseIntArray; Loading Loading @@ -215,4 +216,11 @@ public abstract class AppOpsManagerInternal { * Sets a global restriction on an op code. * Sets a global restriction on an op code. */ */ public abstract void setGlobalRestriction(int code, boolean restricted, IBinder token); public abstract void setGlobalRestriction(int code, boolean restricted, IBinder token); /** * Gets the number of tokens restricting the given appop for a user, package, and * attributionTag. */ public abstract int getOpRestrictionCount(int code, UserHandle user, String pkg, String attributionTag); } } core/java/android/hardware/camera2/CameraMetadata.java +20 −6 Original line number Original line Diff line number Diff line Loading @@ -991,13 +991,27 @@ public abstract class CameraMetadata<TKey> { * camera's crop region is set to maximum size, the FOV of the physical streams for the * camera's crop region is set to maximum size, the FOV of the physical streams for the * ultrawide lens will be the same as the logical stream, by making the crop region * ultrawide lens will be the same as the logical stream, by making the crop region * smaller than its active array size to compensate for the smaller focal length.</p> * smaller than its active array size to compensate for the smaller focal length.</p> * <p>Even if the underlying physical cameras have different RAW characteristics (such as * <p>There are two ways for the application to capture RAW images from a logical camera * size or CFA pattern), a logical camera can still advertise RAW capability. In this * with RAW capability:</p> * case, when the application configures a RAW stream, the camera device will make sure * <ul> * the active physical camera will remain active to ensure consistent RAW output * <li>Because the underlying physical cameras may have different RAW capabilities (such * behavior, and not switch to other physical cameras.</p> * as resolution or CFA pattern), to maintain backward compatibility, when a RAW stream * is configured, the camera device makes sure the default active physical camera remains * active and does not switch to other physical cameras. (One exception is that, if the * logical camera consists of identical image sensors and advertises multiple focalLength * due to different lenses, the camera device may generate RAW images from different * physical cameras based on the focalLength being set by the application.) This * backward-compatible approach usually results in loss of optical zoom, to telephoto * lens or to ultrawide lens.</li> * <li>Alternatively, to take advantage of the full zoomRatio range of the logical camera, * the application should use {@link android.hardware.camera2.MultiResolutionImageReader } * to capture RAW images from the currently active physical camera. Because different * physical camera may have different RAW characteristics, the application needs to use * the characteristics and result metadata of the active physical camera for the * relevant RAW metadata.</li> * </ul> * <p>The capture request and result metadata tags required for backward compatible camera * <p>The capture request and result metadata tags required for backward compatible camera * functionalities will be solely based on the logical camera capabiltity. On the other * functionalities will be solely based on the logical camera capability. On the other * hand, the use of manual capture controls (sensor or post-processing) with a * hand, the use of manual capture controls (sensor or post-processing) with a * logical camera may result in unexpected behavior when the HAL decides to switch * logical camera may result in unexpected behavior when the HAL decides to switch * between physical cameras with different characteristics under the hood. For example, * between physical cameras with different characteristics under the hood. For example, Loading Loading
apex/appsearch/framework/java/external/android/app/appsearch/GenericDocument.java +0 −12 Original line number Original line Diff line number Diff line Loading @@ -51,9 +51,6 @@ import java.util.Set; public class GenericDocument { public class GenericDocument { private static final String TAG = "AppSearchGenericDocumen"; private static final String TAG = "AppSearchGenericDocumen"; /** The maximum {@link String#length} of a {@link String} field. */ private static final int MAX_STRING_LENGTH = 20_000; /** The maximum number of indexed properties a document can have. */ /** The maximum number of indexed properties a document can have. */ private static final int MAX_INDEXED_PROPERTIES = 16; private static final int MAX_INDEXED_PROPERTIES = 16; Loading Loading @@ -1286,15 +1283,6 @@ public class GenericDocument { for (int i = 0; i < values.length; i++) { for (int i = 0; i < values.length; i++) { if (values[i] == null) { if (values[i] == null) { throw new IllegalArgumentException("The String at " + i + " is null."); throw new IllegalArgumentException("The String at " + i + " is null."); } else if (values[i].length() > MAX_STRING_LENGTH) { throw new IllegalArgumentException( "The String at " + i + " length is: " + values[i].length() + ", which exceeds length limit: " + MAX_STRING_LENGTH + "."); } } } } mProperties.putStringArray(name, values); mProperties.putStringArray(name, values); Loading
apex/appsearch/service/java/com/android/server/appsearch/AppSearchManagerService.java +4 −22 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.server.appsearch; import static android.app.appsearch.AppSearchResult.throwableToFailedResult; import static android.app.appsearch.AppSearchResult.throwableToFailedResult; import static android.os.Process.INVALID_UID; import static android.os.Process.INVALID_UID; import android.Manifest; import android.annotation.ElapsedRealtimeLong; import android.annotation.ElapsedRealtimeLong; import android.annotation.NonNull; import android.annotation.NonNull; import android.app.appsearch.AppSearchBatchResult; import android.app.appsearch.AppSearchBatchResult; Loading Loading @@ -1354,43 +1353,26 @@ public class AppSearchManagerService extends SystemService { /** /** * Helper for dealing with incoming user arguments to system service calls. * Helper for dealing with incoming user arguments to system service calls. * * * <p>Takes care of checking permissions and converting USER_CURRENT to the actual current user. * * @param requestedUser The user which the caller is requesting to execute as. * @param requestedUser The user which the caller is requesting to execute as. * @param callingUid The actual uid of the caller as determined by Binder. * @param callingUid The actual uid of the caller as determined by Binder. * @return the user handle that the call should run as. Will always be a concrete user. * @return the user handle that the call should run as. Will always be a concrete user. */ */ @NonNull @NonNull private UserHandle handleIncomingUser(@NonNull UserHandle requestedUser, int callingUid) { private UserHandle handleIncomingUser(@NonNull UserHandle requestedUser, int callingUid) { int callingPid = Binder.getCallingPid(); UserHandle callingUser = UserHandle.getUserHandleForUid(callingUid); UserHandle callingUser = UserHandle.getUserHandleForUid(callingUid); if (callingUser.equals(requestedUser)) { if (callingUser.equals(requestedUser)) { return requestedUser; return requestedUser; } } // Duplicates UserController#ensureNotSpecialUser // Duplicates UserController#ensureNotSpecialUser if (requestedUser.getIdentifier() < 0) { if (requestedUser.getIdentifier() < 0) { throw new IllegalArgumentException( throw new IllegalArgumentException( "Call does not support special user " + requestedUser); "Call does not support special user " + requestedUser); } } boolean canInteractAcrossUsers = mContext.checkPermission( Manifest.permission.INTERACT_ACROSS_USERS, callingPid, callingUid) == PackageManager.PERMISSION_GRANTED; if (!canInteractAcrossUsers) { canInteractAcrossUsers = mContext.checkPermission( Manifest.permission.INTERACT_ACROSS_USERS_FULL, callingPid, callingUid) == PackageManager.PERMISSION_GRANTED; } if (canInteractAcrossUsers) { return requestedUser; } throw new SecurityException( throw new SecurityException( "Permission denied while calling from uid " + callingUid "Requested user, " + requestedUser + ", is not the same as the calling user, " + " with " + requestedUser + "; Need to run as either the calling user (" + callingUser + "."); + callingUser + "), or with one of the following permissions: " + Manifest.permission.INTERACT_ACROSS_USERS + " or " + Manifest.permission.INTERACT_ACROSS_USERS_FULL); } } /** /** Loading
apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -4635,7 +4635,6 @@ public class AlarmManagerService extends SystemService { Slog.d(TAG, "Package " + packageName + " for user " + userId + " now in bucket " + Slog.d(TAG, "Package " + packageName + " for user " + userId + " now in bucket " + bucket); bucket); } } mHandler.removeMessages(AlarmHandler.APP_STANDBY_BUCKET_CHANGED); mHandler.obtainMessage(AlarmHandler.APP_STANDBY_BUCKET_CHANGED, userId, -1, packageName) mHandler.obtainMessage(AlarmHandler.APP_STANDBY_BUCKET_CHANGED, userId, -1, packageName) .sendToTarget(); .sendToTarget(); } } Loading
core/java/android/app/AppOpsManagerInternal.java +8 −0 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.app.AppOpsManager.AttributionFlags; import android.app.AppOpsManager.AttributionFlags; import android.content.AttributionSource; import android.content.AttributionSource; import android.os.IBinder; import android.os.IBinder; import android.os.UserHandle; import android.util.SparseArray; import android.util.SparseArray; import android.util.SparseIntArray; import android.util.SparseIntArray; Loading Loading @@ -215,4 +216,11 @@ public abstract class AppOpsManagerInternal { * Sets a global restriction on an op code. * Sets a global restriction on an op code. */ */ public abstract void setGlobalRestriction(int code, boolean restricted, IBinder token); public abstract void setGlobalRestriction(int code, boolean restricted, IBinder token); /** * Gets the number of tokens restricting the given appop for a user, package, and * attributionTag. */ public abstract int getOpRestrictionCount(int code, UserHandle user, String pkg, String attributionTag); } }
core/java/android/hardware/camera2/CameraMetadata.java +20 −6 Original line number Original line Diff line number Diff line Loading @@ -991,13 +991,27 @@ public abstract class CameraMetadata<TKey> { * camera's crop region is set to maximum size, the FOV of the physical streams for the * camera's crop region is set to maximum size, the FOV of the physical streams for the * ultrawide lens will be the same as the logical stream, by making the crop region * ultrawide lens will be the same as the logical stream, by making the crop region * smaller than its active array size to compensate for the smaller focal length.</p> * smaller than its active array size to compensate for the smaller focal length.</p> * <p>Even if the underlying physical cameras have different RAW characteristics (such as * <p>There are two ways for the application to capture RAW images from a logical camera * size or CFA pattern), a logical camera can still advertise RAW capability. In this * with RAW capability:</p> * case, when the application configures a RAW stream, the camera device will make sure * <ul> * the active physical camera will remain active to ensure consistent RAW output * <li>Because the underlying physical cameras may have different RAW capabilities (such * behavior, and not switch to other physical cameras.</p> * as resolution or CFA pattern), to maintain backward compatibility, when a RAW stream * is configured, the camera device makes sure the default active physical camera remains * active and does not switch to other physical cameras. (One exception is that, if the * logical camera consists of identical image sensors and advertises multiple focalLength * due to different lenses, the camera device may generate RAW images from different * physical cameras based on the focalLength being set by the application.) This * backward-compatible approach usually results in loss of optical zoom, to telephoto * lens or to ultrawide lens.</li> * <li>Alternatively, to take advantage of the full zoomRatio range of the logical camera, * the application should use {@link android.hardware.camera2.MultiResolutionImageReader } * to capture RAW images from the currently active physical camera. Because different * physical camera may have different RAW characteristics, the application needs to use * the characteristics and result metadata of the active physical camera for the * relevant RAW metadata.</li> * </ul> * <p>The capture request and result metadata tags required for backward compatible camera * <p>The capture request and result metadata tags required for backward compatible camera * functionalities will be solely based on the logical camera capabiltity. On the other * functionalities will be solely based on the logical camera capability. On the other * hand, the use of manual capture controls (sensor or post-processing) with a * hand, the use of manual capture controls (sensor or post-processing) with a * logical camera may result in unexpected behavior when the HAL decides to switch * logical camera may result in unexpected behavior when the HAL decides to switch * between physical cameras with different characteristics under the hood. For example, * between physical cameras with different characteristics under the hood. For example, Loading