Skip to content

Commit

Permalink
修正 POST_NOTIFICATIONS 没有跳转到具体的通知权限设置页的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
getActivity committed May 21, 2023
1 parent 4c929a7 commit adc4a9f
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 77 deletions.
8 changes: 4 additions & 4 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

* project address: [Github](https://github.com/getActivity/XXPermissions)

* [Click here to download demo apk directly](https://github.com/getActivity/XXPermissions/releases/download/18.0/XXPermissions.apk)
* [Click here to download demo apk directly](https://github.com/getActivity/XXPermissions/releases/download/18.2/XXPermissions.apk)

![](picture/en/demo_request_permission_activity.jpg) ![](picture/en/demo_request_single_permission.jpg) ![](picture/en/demo_request_group_permission.jpg)

Expand Down Expand Up @@ -55,7 +55,7 @@ android {
dependencies {
// Permission request framework:https://github.com/getActivity/XXPermissions
implementation 'com.github.getActivity:XXPermissions:18.0'
implementation 'com.github.getActivity:XXPermissions:18.2'
}
```

Expand Down Expand Up @@ -209,7 +209,7 @@ XXPermissions.setInterceptor(new IPermissionInterceptor() {});

| Adaptation details | [XXPermissions](https://github.com/getActivity/XXPermissions) | [AndPermission](https://github.com/yanzhenjie/AndPermission) | [PermissionX](https://github.com/guolindev/PermissionX) | [AndroidUtilCode-PermissionUtils](https://github.com/Blankj/AndroidUtilCode) | [PermissionsDispatcher](https://github.com/permissions-dispatcher/PermissionsDispatcher) | [RxPermissions](https://github.com/tbruyelle/RxPermissions) | [EasyPermissions](https://github.com/googlesamples/easypermissions) |
| :-----------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------: |
| Corresponding version | 18.0 | 2.0.3 | 1.7.1 | 1.31.0 | 4.9.2 | 0.12 | 3.0.0 |
| Corresponding version | 18.2 | 2.0.3 | 1.7.1 | 1.31.0 | 4.9.2 | 0.12 | 3.0.0 |
| Number of issues | [![](https://img.shields.io/github/issues/getActivity/XXPermissions.svg)](https://github.com/getActivity/XXPermissions/issues) | [![](https://img.shields.io/github/issues/yanzhenjie/AndPermission.svg)](https://github.com/yanzhenjie/AndPermission/issues) | [![](https://img.shields.io/github/issues/guolindev/PermissionX.svg)](https://github.com/guolindev/PermissionX/issues) | [![](https://img.shields.io/github/issues/Blankj/AndroidUtilCode.svg)](https://github.com/Blankj/AndroidUtilCode/issues) | [![](https://img.shields.io/github/issues/permissions-dispatcher/PermissionsDispatcher.svg)](https://github.com/permissions-dispatcher/PermissionsDispatcher/issues) | [![](https://img.shields.io/github/issues/tbruyelle/RxPermissions.svg)](https://github.com/tbruyelle/RxPermissions/issues) | [![](https://img.shields.io/github/issues/googlesamples/easypermissions.svg)](https://github.com/googlesamples/easypermissions/issues) |
| Framework volume | 82 KB | 127 KB | 97 KB | 500 KB | 99 KB | 28 KB | 48 KB |
| Framework Maintenance Status | **In maintenance** | stop maintenance | **In maintenance** | stop maintenance | stop maintenance | stop maintenance | stop maintenance |
Expand Down Expand Up @@ -351,7 +351,7 @@ XXPermissions.setInterceptor(new IPermissionInterceptor() {});

* Title bar framework: [TitleBar](https://github.com/getActivity/TitleBar)![](https://img.shields.io/github/stars/getActivity/TitleBar.svg)![](https://img.shields.io/github/forks/getActivity/TitleBar.svg)

* Floating window framework: [XToast](https://github.com/getActivity/XToast)![](https://img.shields.io/github/stars/getActivity/XToast.svg)![](https://img.shields.io/github/forks/getActivity/XToast.svg)
* Floating window framework: [EasyWindow](https://github.com/getActivity/EasyWindow)![](https://img.shields.io/github/stars/getActivity/EasyWindow.svg)![](https://img.shields.io/github/forks/getActivity/EasyWindow.svg)

* Shape view framework: [ShapeView](https://github.com/getActivity/ShapeView)![](https://img.shields.io/github/stars/getActivity/ShapeView.svg)![](https://img.shields.io/github/forks/getActivity/ShapeView.svg)

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

* 博文地址:[一句代码搞定权限请求,从未如此简单](https://www.jianshu.com/p/c69ff8a445ed)

* 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处可直接下载](https://github.com/getActivity/XXPermissions/releases/download/18.0/XXPermissions.apk)
* 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处可直接下载](https://github.com/getActivity/XXPermissions/releases/download/18.2/XXPermissions.apk)

![](picture/zh/download_demo_apk_qr_code.png)

Expand Down Expand Up @@ -61,7 +61,7 @@ android {
dependencies {
// 权限请求框架:https://github.com/getActivity/XXPermissions
implementation 'com.github.getActivity:XXPermissions:18.0'
implementation 'com.github.getActivity:XXPermissions:18.2'
}
```

Expand Down Expand Up @@ -215,7 +215,7 @@ XXPermissions.setInterceptor(new IPermissionInterceptor() {});

| 适配细节 | [XXPermissions](https://github.com/getActivity/XXPermissions) | [AndPermission](https://github.com/yanzhenjie/AndPermission) | [PermissionX](https://github.com/guolindev/PermissionX) | [AndroidUtilCode-PermissionUtils](https://github.com/Blankj/AndroidUtilCode) | [PermissionsDispatcher](https://github.com/permissions-dispatcher/PermissionsDispatcher) | [RxPermissions](https://github.com/tbruyelle/RxPermissions) | [EasyPermissions](https://github.com/googlesamples/easypermissions) |
| :--------: | :------------: | :------------: | :------------: | :------------: | :------------: | :------------: | :------------: |
| 对应版本 | 18.0 | 2.0.3 | 1.7.1 | 1.31.0 | 4.9.2 | 0.12 | 3.0.0 |
| 对应版本 | 18.2 | 2.0.3 | 1.7.1 | 1.31.0 | 4.9.2 | 0.12 | 3.0.0 |
| issues 数 | [![](https://img.shields.io/github/issues/getActivity/XXPermissions.svg)](https://github.com/getActivity/XXPermissions/issues) | [![](https://img.shields.io/github/issues/yanzhenjie/AndPermission.svg)](https://github.com/yanzhenjie/AndPermission/issues) | [![](https://img.shields.io/github/issues/guolindev/PermissionX.svg)](https://github.com/guolindev/PermissionX/issues) | [![](https://img.shields.io/github/issues/Blankj/AndroidUtilCode.svg)](https://github.com/Blankj/AndroidUtilCode/issues) | [![](https://img.shields.io/github/issues/permissions-dispatcher/PermissionsDispatcher.svg)](https://github.com/permissions-dispatcher/PermissionsDispatcher/issues) | [![](https://img.shields.io/github/issues/tbruyelle/RxPermissions.svg)](https://github.com/tbruyelle/RxPermissions/issues) | [![](https://img.shields.io/github/issues/googlesamples/easypermissions.svg)](https://github.com/googlesamples/easypermissions/issues) |
| 框架体积 | 82 KB | 127 KB | 97 KB | 500 KB | 99 KB | 28 KB | 48 KB |
| 框架维护状态 |**维护中**| 停止维护 | 停止维护 | 停止维护 | 停止维护 | 停止维护 | 停止维护 |
Expand Down Expand Up @@ -387,7 +387,7 @@ XXPermissions.setInterceptor(new IPermissionInterceptor() {});

* 标题栏框架:[TitleBar](https://github.com/getActivity/TitleBar) ![](https://img.shields.io/github/stars/getActivity/TitleBar.svg) ![](https://img.shields.io/github/forks/getActivity/TitleBar.svg)

* 悬浮窗框架:[XToast](https://github.com/getActivity/XToast) ![](https://img.shields.io/github/stars/getActivity/XToast.svg) ![](https://img.shields.io/github/forks/getActivity/XToast.svg)
* 悬浮窗框架:[EasyWindow](https://github.com/getActivity/EasyWindow) ![](https://img.shields.io/github/stars/getActivity/EasyWindow.svg) ![](https://img.shields.io/github/forks/getActivity/EasyWindow.svg)

* Shape 框架:[ShapeView](https://github.com/getActivity/ShapeView) ![](https://img.shields.io/github/stars/getActivity/ShapeView.svg) ![](https://img.shields.io/github/forks/getActivity/ShapeView.svg)

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.hjq.permissions.demo"
minSdkVersion 16
targetSdkVersion 33
versionCode 1800
versionName "18.0"
versionCode 1802
versionName "18.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<service
android:name=".NotificationMonitorService"
android:exported="false"
android:process=":test"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE" >
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {

defaultConfig {
minSdkVersion 14
versionCode 1800
versionName "18.0"
versionCode 1802
versionName "18.2"
}

// 使用 JDK 1.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ static Intent getPermissionIntent(@NonNull Context context) {
intent = PermissionIntentManager.getMiuiPermissionPageIntent(context);
}
// 另外跳转到应用详情页也可以开启读取应用列表权限
intent = StartActivityManager.addSubIntentToMainIntent(intent, PermissionUtils.getApplicationDetailsIntent(context));
intent = StartActivityManager.addSubIntentToMainIntent(intent, PermissionIntentManager.getApplicationDetailsIntent(context));
return intent;
}

return PermissionUtils.getApplicationDetailsIntent(context);
return PermissionIntentManager.getApplicationDetailsIntent(context);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static Intent getPermissionIntent(@NonNull Context context) {
}

if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static Intent getPermissionIntent(@NonNull Context context) {
intent.putExtra("app_uid", context.getApplicationInfo().uid);
}
if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ static void checkManifestPermissions(@NonNull Context context, @NonNull List<Str
}

if (PermissionUtils.equalsPermission(permission, Permission.GET_INSTALLED_APPS)) {
// 申请读取应用列表权限需要在清单文件中注册 QUERY_ALL_PACKAGES
// 否则申请 GET_INSTALLED_APPS 权限成功也是白搭,是获取不到第三方安装列表信息的
// 申请读取应用列表权限需要在清单文件中注册 QUERY_ALL_PACKAGES 权限
// 否则就算申请 GET_INSTALLED_APPS 权限成功也是白搭,也是获取不到第三方安装列表信息的
// Manifest.permission.QUERY_ALL_PACKAGES
checkManifestPermission(permissionInfoList, "android.permission.QUERY_ALL_PACKAGES");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Intent getPermissionIntent(@NonNull Context context, @NonNull String perm
return getVpnPermissionIntent(context);
}

return PermissionUtils.getApplicationDetailsIntent(context);
return PermissionIntentManager.getApplicationDetailsIntent(context);
}

/**
Expand All @@ -53,7 +53,7 @@ private static boolean isGrantedVpnPermission(@NonNull Context context) {
private static Intent getVpnPermissionIntent(@NonNull Context context) {
Intent intent = VpnService.prepare(context);
if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static Intent getPackagePermissionIntent(@NonNull Context context) {
intent.setData(PermissionUtils.getPackageNameUri(context));
}
if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private static Intent getSettingPermissionIntent(@NonNull Context context) {
Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
intent.setData(PermissionUtils.getPackageNameUri(context));
if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down Expand Up @@ -294,7 +294,7 @@ private static Intent getNotDisturbPermissionIntent(@NonNull Context context) {
}

if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand All @@ -318,7 +318,7 @@ private static Intent getIgnoreBatteryPermissionIntent(@NonNull Context context)
}

if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private static Intent getInstallPermissionIntent(@NonNull Context context) {
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES);
intent.setData(PermissionUtils.getPackageNameUri(context));
if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand All @@ -98,7 +98,7 @@ private static Intent getPictureInPicturePermissionIntent(@NonNull Context conte
Intent intent = new Intent("android.settings.PICTURE_IN_PICTURE_SETTINGS");
intent.setData(PermissionUtils.getPackageNameUri(context));
if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static Intent getManageStoragePermissionIntent(@NonNull Context context)
}

if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static Intent getAlarmPermissionIntent(@NonNull Context context) {
Intent intent = new Intent(Settings.ACTION_REQUEST_SCHEDULE_EXACT_ALARM);
intent.setData(PermissionUtils.getPackageNameUri(context));
if (!PermissionUtils.areActivityIntent(context, intent)) {
intent = PermissionUtils.getApplicationDetailsIntent(context);
intent = PermissionIntentManager.getApplicationDetailsIntent(context);
}
return intent;
}
Expand Down
Loading

0 comments on commit adc4a9f

Please sign in to comment.