All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.xml.rules.xml.S6359.html Maven / Gradle / Ivy

There is a newer version: 2.11.0.5671
Show newest version

Why is this an issue?

Defining a custom permission in the android.permission namespace may result in an unexpected permission assignment if a newer version of Android adds a permission with the same name. It is recommended to use a namespace specific to the application for custom permissions.

Noncompliant code example

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.organization.app">

    <permission
        android:name="android.permission.MYPERMISSION" /> <!-- Noncompliant -->

</manifest>

Compliant solution

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.organization.app">

    <permission
        android:name="com.organization.app.permission.MYPERMISSION" />

</manifest>

Resources





© 2015 - 2025 Weber Informatics LLC | Privacy Policy