As explained in the following StackOverflow post answer: [link1], I added a new location permission code with a new name "ACCESS_NEW_LOCATION" in (frameworks/base/core/res/AndroidManifest.xml) of AOSP. I build the AOSP source code after adding the code snippet as explained in StackOverflow post: [link2].
The code snippet added is:
<permission android:name="android.permission.ACCESS_NEW_LOCATION"
android:permissionGroup="android.permission-group.LOCATION"
android:label="@string/permlab_accessNewLocation"
android:description="@string/permdesc_accessNewLocation"
android:protectionLevel="dangerous" />
But, in Android studio in which I use the following code to access the newly added AOSP permission as:
<uses-permission android:name="android.permission.ACCESS_NEW_LOCATION"/>
The Android Studio doesn't recognize the name of this new permission name. Also, I did a listing of permissions available to Android Phone as explained in this StackOverflow post: [link3]. In the output, both system and user permission were listed there but the name of newly added permission "ACCESS_NEW_LOCATION" did not appear.
Could you please help me on:
- What is the correct procedure to add a new permission to AOSP?
- How to make Android Studio aware of this newly added permission in AOSP.
- Since this newly added permission is in XML file in AOSP, I think it will only add a name; but where is the code snippet located in AOSP corresponding to this newly added permission where we can define the functionality of this newly added permission.