Skip to content

Commit

Permalink
Add TargetApi annotation in PermissionUtils.java for Android (Baseflo…
Browse files Browse the repository at this point in the history
…w#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 <[email protected]>
  • Loading branch information
2 people authored and dogiaplinh committed Sep 13, 2024
1 parent 6116c82 commit 58fa209
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion permission_handler_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 12.0.11

* Adds `TargetApi` annotation to `getManifestNames` method in `PermissionUtils.java`.

## 12.0.10

* 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`).
Expand All @@ -18,7 +22,6 @@

* 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)).


## 12.0.5

* Upgrades Gradle and Android Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.baseflow.permissionhandler;

import android.Manifest;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -99,6 +100,7 @@ static int parseManifestName(String permission) {
}
}

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

Expand Down
2 changes: 1 addition & 1 deletion permission_handler_android/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: permission_handler_android
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
homepage: https://github.com/baseflow/flutter-permission-handler
version: 12.0.10
version: 12.0.11

environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down

0 comments on commit 58fa209

Please sign in to comment.