Skip to content

Commit 39fba43

Browse files
Add TargetApi annotation in PermissionUtils.java for Android (#1122)
* added iOS imports * added java code style suggestions to PermissionUtils.java * fix PermissionHandlerEnums.h import in Codec.h * Edited pubspec.yaml and CHANGELOG.md files * Edited pubspec.yaml and CHANGELOG.md for android * fixed formatting error in android CHANGELOG * Remove iOS changes * Update CHANGELOG.md * Remove fall through comment in PermissionUtils.java --------- Co-authored-by: Maurits van Beusekom <maurits@vnbskm.nl>
1 parent eb92a1d commit 39fba43

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

permission_handler_android/CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 12.0.11
2+
3+
* Adds `TargetApi` annotation to `getManifestNames` method in `PermissionUtils.java`.
4+
15
## 12.0.10
26

37
* Fixes a bug that causes a `NullPointerException` when the application is restarted after being killed by Android during the request of special permissions (like, `Permission.ignoreBatteryOptimizations`, `Permission.systemAlertWindow`, `Permission.accessNotificationPolicy`, `Permission.scheduleExactAlarm` and `Permission.manageExternalStorage`).
@@ -18,7 +22,6 @@
1822

1923
* Removes deprecated support for Android V1 embedding as support will be removed from Flutter (see [flutter/flutter#144726](https://github.com/flutter/flutter/pull/144726)).
2024

21-
2225
## 12.0.5
2326

2427
* Upgrades Gradle and Android Gradle plugin.

permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.baseflow.permissionhandler;
22

33
import android.Manifest;
4+
import android.annotation.TargetApi;
45
import android.app.Activity;
56
import android.content.Context;
67
import android.content.SharedPreferences;
@@ -99,6 +100,7 @@ static int parseManifestName(String permission) {
99100
}
100101
}
101102

103+
@TargetApi(22)
102104
static List<String> getManifestNames(Context context, @PermissionConstants.PermissionGroup int permission) {
103105
final ArrayList<String> permissionNames = new ArrayList<>();
104106

permission_handler_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: permission_handler_android
22
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
33
homepage: https://github.com/baseflow/flutter-permission-handler
4-
version: 12.0.10
4+
version: 12.0.11
55

66
environment:
77
sdk: ">=2.15.0 <4.0.0"

0 commit comments

Comments
 (0)