Skip to content

Commit e22b26c

Browse files
authored
Implement queries instead of blanket QUERY_ALL_PACKAGES permission (#1652)
* Remove QUERY_ALL_PACKAGES from Validator * Update helloSDL manifest with queries
1 parent adb70ea commit e22b26c

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

android/hello_sdl_android/src/main/AndroidManifest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
<!-- Required to use the USB Accessory mode -->
1313
<uses-feature android:name="android.hardware.usb.accessory" />
1414

15+
<!-- Required when targeting Android API 30+ -->
16+
<queries>
17+
<intent>
18+
<action android:name="com.smartdevicelink.router.service" />
19+
</intent>
20+
<intent>
21+
<action android:name="sdl.router.startservice" />
22+
</intent>
23+
</queries>
24+
1525
<application
1626
android:allowBackup="false"
1727
android:icon="@mipmap/ic_launcher"

android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public class IntegrationValidator {
5252
private static final char CHECK_MARK = 0x2713;
5353
private static final char FAIL_MARK = 0x2715;
5454

55-
//FIXME When the CI is stable with API 30 use Manifest.permission.QUERY_ALL_PACKAGES instead
56-
private static final String QUERY_ALL_PACKAGES = "android.permission.QUERY_ALL_PACKAGES";
57-
5855
public static final int FLAG_SKIP_ROUTER_SERVICE_CHECK = 0x01;
5956

6057

@@ -117,9 +114,6 @@ private static ValidationResult checkPermissions(Context context) {
117114
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
118115
permissionList.add(Manifest.permission.FOREGROUND_SERVICE);
119116
}
120-
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
121-
permissionList.add(QUERY_ALL_PACKAGES);
122-
}
123117
try {
124118
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getApplicationContext().getPackageName(), PackageManager.GET_PERMISSIONS);
125119
String[] permissionInfos = packageInfo.requestedPermissions;

0 commit comments

Comments
 (0)