PMD: Enable and obey PrematureDeclaration
This commit is contained in:
parent
32c67d05ec
commit
5d3d8786e2
@ -328,9 +328,6 @@ public class InstallExtensionDialogActivity extends FragmentActivity {
|
|||||||
* 3. Verify that install worked
|
* 3. Verify that install worked
|
||||||
*/
|
*/
|
||||||
private void postInstall() {
|
private void postInstall() {
|
||||||
// hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay
|
|
||||||
ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId());
|
|
||||||
|
|
||||||
int isInstalledCorrectly =
|
int isInstalledCorrectly =
|
||||||
PrivilegedInstaller.isExtensionInstalledCorrectly(this);
|
PrivilegedInstaller.isExtensionInstalledCorrectly(this);
|
||||||
|
|
||||||
@ -367,6 +364,9 @@ public class InstallExtensionDialogActivity extends FragmentActivity {
|
|||||||
throw new RuntimeException("unhandled return");
|
throw new RuntimeException("unhandled return");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hack to get theme applied (which is not automatically applied due to activity's Theme.NoDisplay
|
||||||
|
ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId());
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(theme)
|
AlertDialog.Builder builder = new AlertDialog.Builder(theme)
|
||||||
.setTitle(title)
|
.setTitle(title)
|
||||||
.setMessage(message)
|
.setMessage(message)
|
||||||
|
@ -420,16 +420,14 @@ public class AppSecurityPermissions {
|
|||||||
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;
|
||||||
final boolean isDangerous = base == PermissionInfo.PROTECTION_DANGEROUS;
|
final boolean isDangerous = base == PermissionInfo.PROTECTION_DANGEROUS;
|
||||||
final boolean wasGranted =
|
|
||||||
(existingReqFlags & PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0;
|
|
||||||
|
|
||||||
// Dangerous and normal permissions are always shown to the user
|
// Dangerous and normal permissions are always shown to the user
|
||||||
if (isNormal || isDangerous) {
|
if (isNormal || isDangerous) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean isDevelopment =
|
final boolean isDevelopment = (pInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0;
|
||||||
(pInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0;
|
final boolean wasGranted = (existingReqFlags & PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0;
|
||||||
|
|
||||||
// Development permissions are only shown to the user if they are already
|
// Development permissions are only shown to the user if they are already
|
||||||
// granted to the app -- if we are installing an app and they are not
|
// granted to the app -- if we are installing an app and they are not
|
||||||
|
@ -15,4 +15,5 @@
|
|||||||
<rule ref="rulesets/java/unnecessary.xml">
|
<rule ref="rulesets/java/unnecessary.xml">
|
||||||
<exclude name="UselessParentheses"/> <!--Too nitpicky-->
|
<exclude name="UselessParentheses"/> <!--Too nitpicky-->
|
||||||
</rule>
|
</rule>
|
||||||
|
<rule ref="rulesets/java/optimizations.xml/PrematureDeclaration"/>
|
||||||
</ruleset>
|
</ruleset>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user