Skip to content

Commit

Permalink
Add TargetApi annotation in PermissionUtils.java for Android (#1122)
Browse files Browse the repository at this point in the history
* 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
victorsanni and mvanbeusekom authored Aug 16, 2024
1 parent eb92a1d commit 39fba43
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 39fba43

Please sign in to comment.