Fix the @RequiresPermission annotation.

We initially were using PACKAGE_USAGE_STATS permission to guard
the API BroadcastOptions.recordResponseEventWhileInBackground()
but changed it's implementation to use the new
ACCESS_BROADCAST_RESPONSE_STATS permission later but didn't update
the annotation to specify the new permission.

Bug: 228894230
Test: treehugger
Change-Id: I5142e2d2f754e8014c0c291d56b5ec2254449e77
This commit is contained in:
Sudheer Shanka
2022-04-11 14:44:39 -07:00
parent 93599ecf92
commit 86ef571dab
2 changed files with 2 additions and 2 deletions

View File

@@ -762,7 +762,7 @@ package android.app {
method public void clearRequireCompatChange();
method public boolean isPendingIntentBackgroundActivityLaunchAllowed();
method public static android.app.BroadcastOptions makeBasic();
method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void recordResponseEventWhileInBackground(@IntRange(from=0) long);
method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RESPONSE_STATS) public void recordResponseEventWhileInBackground(@IntRange(from=0) long);
method @RequiresPermission(android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND) public void setBackgroundActivityStartsAllowed(boolean);
method public void setDontSendToRestrictedApps(boolean);
method public void setPendingIntentBackgroundActivityLaunchAllowed(boolean);

View File

@@ -532,7 +532,7 @@ public class BroadcastOptions extends ComponentOptions {
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS)
@RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RESPONSE_STATS)
public void recordResponseEventWhileInBackground(@IntRange(from = 0) long id) {
mIdForResponseEvent = id;
}