For instance, let’s take android.permission.GET_PACKAGE_SIZE.
Searching for this string in Android 1.6 *.xml source files only points to a single application that uses it, frameworks\base\tests\AndroidTests.
So the next step is to search through the .java files in a hope that I’ll eventually find the code that might look like it queries for package size.
Is this the supposed way of discovering permission use?
Generally speaking, you find out what permissions you need because they are referenced from APIs you want to use, normally in the docs, occasionally by exceptions.
Conversely, if a given permission is not cited in the docs, except where it is named (e.g., on
Manifest.permission), then it is probably a system permission that you are ineligible to hold unless you are working on alternative firmware.And, if you are working on alternative firmware, you’d be well-versed in searching the source code. I use Google Code Search, personally, such as this search for your desired permission.
So, in the case of
GET_PACKAGE_SIZE, the only place you find it in the docs is inManifest.permission, and the only place the source code requires it is in a non-SDK method, so I suspect you cannot hold it.