error on NewApi/InlinedApi to catch compat issues with old devices

This commit is contained in:
Hans-Christoph Steiner 2018-08-10 11:23:20 +02:00
parent 897a35aa76
commit 2f038d81e0
2 changed files with 26 additions and 23 deletions

View File

@ -9,6 +9,8 @@
<issue id="ImpliedQuantity" severity="error"/> <issue id="ImpliedQuantity" severity="error"/>
<issue id="DefaultLocale" severity="error"/> <issue id="DefaultLocale" severity="error"/>
<issue id="NewApi" severity="error"/>
<issue id="InlinedApi" severity="error"/>
<!-- These are important to us, so promote from warning to error --> <!-- These are important to us, so promote from warning to error -->
<issue id="UnusedResources" severity="error"> <issue id="UnusedResources" severity="error">

View File

@ -65,17 +65,17 @@ import java.util.Set;
* extended information consisting of all groups and permissions. * extended information consisting of all groups and permissions.
* To use this view define a LinearLayout or any ViewGroup and add this * To use this view define a LinearLayout or any ViewGroup and add this
* view by instantiating AppSecurityPermissions and invoking getPermissionsView. * view by instantiating AppSecurityPermissions and invoking getPermissionsView.
* <p/> * <p>
* NOTES: * NOTES:
* Based on AOSP core/java/android/widget/AppSecurityPermissions.java * Based on AOSP {@code core/java/android/widget/AppSecurityPermissions.java},
* latest included commit: a3f68ef2f6811cf72f1282214c0883db5a30901d * latest included commit: a3f68ef2f6811cf72f1282214c0883db5a30901d,
* Reviewed against frameworks/base/core/java/android/widget/AppSecurityPermissions.java * Reviewed against {@code frameworks/base/core/java/android/widget/AppSecurityPermissions.java},
* from commit {@code android-8.1.0_r2} * from commit {@code android-8.1.0_r2}
* <p/> * <p>
* To update this file, Start from latest included commit and include changes * To update this file, Start from latest included commit and include changes
* until the newest commit with care: * until the newest commit with care:
* github.com/android/platform_frameworks_base/blob/master/core/java/android/widget/AppSecurityPermissions.java * <a href="http://github.com/android/platform_frameworks_base/blob/master/core/java/android/widget/AppSecurityPermissions">android/widget/AppSecurityPermissions.java</a>
* <p/> * <p>
* This file has a different code style than the rest of fdroidclient because * This file has a different code style than the rest of fdroidclient because
* it is kept in sync with the file from AOSP. Please maintain the original * it is kept in sync with the file from AOSP. Please maintain the original
* AOSP code style so it is easy to track changes. * AOSP code style so it is easy to track changes.
@ -426,6 +426,7 @@ public class AppSecurityPermissions {
return permView; return permView;
} }
@TargetApi(23)
private boolean isDisplayablePermission(PermissionInfo pInfo, int existingReqFlags) { private boolean isDisplayablePermission(PermissionInfo pInfo, int existingReqFlags) {
final int base = pInfo.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE; final int base = pInfo.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE;
final boolean isNormal = base == PermissionInfo.PROTECTION_NORMAL; final boolean isNormal = base == PermissionInfo.PROTECTION_NORMAL;