Loading Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,7 @@ java_defaults { libs: [ "app-compat-annotations", "ext", "framework-connectivity-annotations", "framework-updatable-stubs-module_libs_api", "unsupportedappusage", ], Loading core/java/android/app/AppOpsManager.java +15 −8 Original line number Diff line number Diff line Loading @@ -7394,20 +7394,27 @@ public class AppOpsManager { /** @hide */ public void setUserRestriction(int code, boolean restricted, IBinder token) { setUserRestriction(code, restricted, token, /*exceptionPackages*/null); setUserRestriction(code, restricted, token, (Map<String, String[]>) null); } /** @hide */ /** * An empty array of attribution tags means exclude all tags under that package. * @hide */ public void setUserRestriction(int code, boolean restricted, IBinder token, String[] exceptionPackages) { setUserRestrictionForUser(code, restricted, token, exceptionPackages, mContext.getUserId()); @Nullable Map<String, String[]> excludedPackageTags) { setUserRestrictionForUser(code, restricted, token, excludedPackageTags, mContext.getUserId()); } /** @hide */ /** * An empty array of attribution tags means exclude all tags under that package. * @hide */ public void setUserRestrictionForUser(int code, boolean restricted, IBinder token, String[] exceptionPackages, int userId) { @Nullable Map<String, String[]> excludedPackageTags, int userId) { try { mService.setUserRestriction(code, restricted, token, userId, exceptionPackages); mService.setUserRestriction(code, restricted, token, userId, excludedPackageTags); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -7949,7 +7956,7 @@ public class AppOpsManager { */ public int unsafeCheckOpRawNoThrow(int op, int uid, @NonNull String packageName) { try { return mService.checkOperationRaw(op, uid, packageName); return mService.checkOperationRaw(op, uid, packageName, null); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/app/AppOpsManagerInternal.java +6 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.internal.util.function.HexFunction; import com.android.internal.util.function.NonaFunction; import com.android.internal.util.function.OctFunction; import com.android.internal.util.function.QuadFunction; import com.android.internal.util.function.QuintFunction; import com.android.internal.util.function.TriFunction; /** Loading @@ -45,12 +46,14 @@ public abstract class AppOpsManagerInternal { * @param code The op code to check. * @param uid The UID for which to check. * @param packageName The package for which to check. * @param superImpl The super implementation. * @param attributionTag The attribution tag for which to check. * @param raw Whether to check the raw op i.e. not interpret the mode based on UID state. * @param superImpl The super implementation. * @return The app op check result. */ int checkOperation(int code, int uid, String packageName, boolean raw, QuadFunction<Integer, Integer, String, Boolean, Integer> superImpl); int checkOperation(int code, int uid, String packageName, @Nullable String attributionTag, boolean raw, QuintFunction<Integer, Integer, String, String, Boolean, Integer> superImpl); /** * Allows overriding check audio operation behavior. Loading core/java/android/app/timezonedetector/TimeZoneDetector.java +7 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,13 @@ public interface TimeZoneDetector { */ String SHELL_COMMAND_SET_AUTO_DETECTION_ENABLED = "set_auto_detection_enabled"; /** * A shell command that prints whether the telephony-based time zone detection feature is * supported on the device. * @hide */ String SHELL_COMMAND_IS_TELEPHONY_DETECTION_SUPPORTED = "is_telephony_detection_supported"; /** * A shell command that prints whether the geolocation-based time zone detection feature is * supported on the device. Loading core/java/android/net/NetworkPolicyManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.Signature; import android.net.ConnectivityAnnotations.MultipathPreference; import android.net.ConnectivityAnnotations.RestrictBackgroundStatus; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.os.Build; Loading Loading @@ -463,6 +465,7 @@ public class NetworkPolicyManager { */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) @RestrictBackgroundStatus public int getRestrictBackgroundStatus(int uid) { try { return mService.getRestrictBackgroundStatus(uid); Loading Loading @@ -588,6 +591,7 @@ public class NetworkPolicyManager { */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) @MultipathPreference public int getMultipathPreference(@NonNull Network network) { try { return mService.getMultipathPreference(network); Loading Loading
Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -313,6 +313,7 @@ java_defaults { libs: [ "app-compat-annotations", "ext", "framework-connectivity-annotations", "framework-updatable-stubs-module_libs_api", "unsupportedappusage", ], Loading
core/java/android/app/AppOpsManager.java +15 −8 Original line number Diff line number Diff line Loading @@ -7394,20 +7394,27 @@ public class AppOpsManager { /** @hide */ public void setUserRestriction(int code, boolean restricted, IBinder token) { setUserRestriction(code, restricted, token, /*exceptionPackages*/null); setUserRestriction(code, restricted, token, (Map<String, String[]>) null); } /** @hide */ /** * An empty array of attribution tags means exclude all tags under that package. * @hide */ public void setUserRestriction(int code, boolean restricted, IBinder token, String[] exceptionPackages) { setUserRestrictionForUser(code, restricted, token, exceptionPackages, mContext.getUserId()); @Nullable Map<String, String[]> excludedPackageTags) { setUserRestrictionForUser(code, restricted, token, excludedPackageTags, mContext.getUserId()); } /** @hide */ /** * An empty array of attribution tags means exclude all tags under that package. * @hide */ public void setUserRestrictionForUser(int code, boolean restricted, IBinder token, String[] exceptionPackages, int userId) { @Nullable Map<String, String[]> excludedPackageTags, int userId) { try { mService.setUserRestriction(code, restricted, token, userId, exceptionPackages); mService.setUserRestriction(code, restricted, token, userId, excludedPackageTags); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -7949,7 +7956,7 @@ public class AppOpsManager { */ public int unsafeCheckOpRawNoThrow(int op, int uid, @NonNull String packageName) { try { return mService.checkOperationRaw(op, uid, packageName); return mService.checkOperationRaw(op, uid, packageName, null); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/app/AppOpsManagerInternal.java +6 −3 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import com.android.internal.util.function.HexFunction; import com.android.internal.util.function.NonaFunction; import com.android.internal.util.function.OctFunction; import com.android.internal.util.function.QuadFunction; import com.android.internal.util.function.QuintFunction; import com.android.internal.util.function.TriFunction; /** Loading @@ -45,12 +46,14 @@ public abstract class AppOpsManagerInternal { * @param code The op code to check. * @param uid The UID for which to check. * @param packageName The package for which to check. * @param superImpl The super implementation. * @param attributionTag The attribution tag for which to check. * @param raw Whether to check the raw op i.e. not interpret the mode based on UID state. * @param superImpl The super implementation. * @return The app op check result. */ int checkOperation(int code, int uid, String packageName, boolean raw, QuadFunction<Integer, Integer, String, Boolean, Integer> superImpl); int checkOperation(int code, int uid, String packageName, @Nullable String attributionTag, boolean raw, QuintFunction<Integer, Integer, String, String, Boolean, Integer> superImpl); /** * Allows overriding check audio operation behavior. Loading
core/java/android/app/timezonedetector/TimeZoneDetector.java +7 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,13 @@ public interface TimeZoneDetector { */ String SHELL_COMMAND_SET_AUTO_DETECTION_ENABLED = "set_auto_detection_enabled"; /** * A shell command that prints whether the telephony-based time zone detection feature is * supported on the device. * @hide */ String SHELL_COMMAND_IS_TELEPHONY_DETECTION_SUPPORTED = "is_telephony_detection_supported"; /** * A shell command that prints whether the geolocation-based time zone detection feature is * supported on the device. Loading
core/java/android/net/NetworkPolicyManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.Signature; import android.net.ConnectivityAnnotations.MultipathPreference; import android.net.ConnectivityAnnotations.RestrictBackgroundStatus; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiInfo; import android.os.Build; Loading Loading @@ -463,6 +465,7 @@ public class NetworkPolicyManager { */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) @RestrictBackgroundStatus public int getRestrictBackgroundStatus(int uid) { try { return mService.getRestrictBackgroundStatus(uid); Loading Loading @@ -588,6 +591,7 @@ public class NetworkPolicyManager { */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) @MultipathPreference public int getMultipathPreference(@NonNull Network network) { try { return mService.getMultipathPreference(network); Loading