Android: Allow modules to specify permissions/features

Some modules, such as Qt Multimedia, needs special permissions
to avoid getting exceptions at run-time. We should apply these
by default to the AndroidManifest.xml so that an application
using e.g. the camera will work out of the box.

Task-number: QTBUG-33953
Change-Id: Ibc1f086d249197b63e7ed1075ae7d54bdd1212f2
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2013-11-07 13:36:31 +01:00 committed by The Qt Project
parent b953e2f53f
commit 42670c7c45
2 changed files with 15 additions and 0 deletions

View File

@ -64,6 +64,19 @@ DEPENDENCY_FILE = $$ANDROID_DEPENDS_DIR$$TARGET-android-dependencies.xml
}
}
!isEmpty(ANDROID_PERMISSIONS) {
for (ANDROID_PERMISSION, ANDROID_PERMISSIONS) {
FILE_CONTENT += "<permission name=\"$$ANDROID_PERMISSION\" />"
}
}
!isEmpty(ANDROID_FEATURES) {
for (ANDROID_FEATURE, ANDROID_FEATURES) {
FILE_CONTENT += "<feature name=\"$$ANDROID_FEATURE\" />"
}
}
!isEmpty(FILE_CONTENT) {
FILE_CONTENT = "<rules><dependencies><lib name=\"$$TARGET\"><depends>" $$FILE_CONTENT "</depends></lib></dependencies></rules>"
write_file($$DEPENDENCY_FILE, FILE_CONTENT) | error("Aborting.")

View File

@ -36,6 +36,8 @@
</application>
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
<!-- %%INSERT_PERMISSIONS -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- %%INSERT_FEATURES -->
</manifest>