[Android] change intents in manifest to match packagename

Geoffrey Métais git at videolan.org
Fri Nov 6 16:30:35 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Nov  6 16:28:42 2015 +0100| [f4af16f60f55aee822f824139dacb1ed8a15a60d] | committer: Geoffrey Métais

change intents in manifest to match packagename

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=f4af16f60f55aee822f824139dacb1ed8a15a60d
---

 vlc-android/AndroidManifest.xml |   18 +++++++++---------
 vlc-android/build.gradle        |   13 +++++++++++--
 2 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/vlc-android/AndroidManifest.xml b/vlc-android/AndroidManifest.xml
index 4611d00..0d45a30 100644
--- a/vlc-android/AndroidManifest.xml
+++ b/vlc-android/AndroidManifest.xml
@@ -426,10 +426,10 @@
             android:label="@string/widget_name_w" >
             <intent-filter>
                 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-                <action android:name="org.videolan.vlc.widget.INIT" />
-                <action android:name="org.videolan.vlc.widget.UPDATE" />
-                <action android:name="org.videolan.vlc.widget.UPDATE_COVER" />
-                <action android:name="org.videolan.vlc.widget.UPDATE_POSITION" />
+                <action android:name="_PACKAGENAME_.widget.INIT" />
+                <action android:name="_PACKAGENAME_.widget.UPDATE" />
+                <action android:name="_PACKAGENAME_.widget.UPDATE_COVER" />
+                <action android:name="_PACKAGENAME_.widget.UPDATE_POSITION" />
             </intent-filter>
 
             <meta-data
@@ -442,10 +442,10 @@
             android:label="@string/widget_name_b" >
             <intent-filter>
                 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
-                <action android:name="org.videolan.vlc.widget.INIT" />
-                <action android:name="org.videolan.vlc.widget.UPDATE" />
-                <action android:name="org.videolan.vlc.widget.UPDATE_COVER" />
-                <action android:name="org.videolan.vlc.widget.UPDATE_POSITION" />
+                <action android:name="_PACKAGENAME_.widget.INIT" />
+                <action android:name="_PACKAGENAME_.widget.UPDATE" />
+                <action android:name="_PACKAGENAME_.widget.UPDATE_COVER" />
+                <action android:name="_PACKAGENAME_.widget.UPDATE_POSITION" />
             </intent-filter>
 
             <meta-data
@@ -455,7 +455,7 @@
         <receiver android:name=".RemoteControlClientReceiver" >
             <intent-filter>
                 <action android:name="android.intent.action.MEDIA_BUTTON" />
-                <action android:name="org.videolan.vlc.remote.PlayPause" />
+                <action android:name="_PACKAGENAME_.remote.PlayPause" />
             </intent-filter>
         </receiver>
     </application>
diff --git a/vlc-android/build.gradle b/vlc-android/build.gradle
index af32349..ef74851 100644
--- a/vlc-android/build.gradle
+++ b/vlc-android/build.gradle
@@ -151,10 +151,19 @@ android {
         variant.outputs.each { output ->
             def outputName = "VLC-Android-"
             if (!variant.productFlavors.get(0).name.equals("vanilla"))
-                outputName += variant.productFlavors.get(0).name.toUpperCase()+"-"
-            outputName += vlcVersion+"-"+variant.productFlavors.get(1).name+".apk"
+                outputName += variant.productFlavors.get(0).name.toUpperCase() + "-"
+            outputName += vlcVersion + "-" + variant.productFlavors.get(1).name + ".apk"
             output.outputFile = new File(output.outputFile.parentFile, outputName);
         }
+
+        //set intents with correct package name
+        variant.outputs.each { output ->
+            output.processManifest.doLast{
+                def manifestOutFile = output.processManifest.manifestOutputFile
+                def newFileContents = manifestOutFile.getText('UTF-8').replace("_PACKAGENAME_", variant.applicationId)
+                manifestOutFile.write(newFileContents, 'UTF-8')
+            }
+        }
     }
 
     sourceSets.main {



More information about the Android mailing list