[Android] Fix widgets crash + fix small typo

Nicolas Pomepuy git at videolan.org
Tue Jan 28 11:05:41 CET 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jan 28 07:06:03 2020 +0100| [44d3276e9f710f7daed082f79c01e6018e16ec14] | committer: Geoffrey Métais

Fix widgets crash + fix small typo

Fixes #1178

> https://code.videolan.org/videolan/vlc-android/commit/44d3276e9f710f7daed082f79c01e6018e16ec14
---

 application/resources/build.gradle                                    | 2 +-
 application/vlc-android/build.gradle                                  | 2 ++
 .../vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.kt   | 4 ++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/application/resources/build.gradle b/application/resources/build.gradle
index 2a1bf3e40..d9d7f1221 100644
--- a/application/resources/build.gradle
+++ b/application/resources/build.gradle
@@ -11,7 +11,7 @@ android {
         versionName "1.0"
 
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
-        buildConfigField "String", "APP_ID", "\"rootProject.ext.appId\""
+        buildConfigField "String", "APP_ID", "\"${rootProject.ext.appId}\""
     }
 
     buildTypes {
diff --git a/application/vlc-android/build.gradle b/application/vlc-android/build.gradle
index fd614f5d2..9482c7133 100644
--- a/application/vlc-android/build.gradle
+++ b/application/vlc-android/build.gradle
@@ -31,6 +31,7 @@ android {
         resValue "string", "build_host", hostName()
         resValue "string", "build_revision", revision()
         resValue 'string', 'tv_provider_authority', "${applicationId}.tv"
+        buildConfigField "String", "APP_ID", "\"${rootProject.ext.appId}\""
 
         testInstrumentationRunner "org.videolan.vlc.MultidexTestRunner"
         // The following argument makes the Android Test Orchestrator run its
@@ -82,6 +83,7 @@ android {
         }
         debug {
             buildConfigField "boolean", "BETA", "false"
+            buildConfigField "String", "APP_ID", "\"${rootProject.ext.appId}.debug\""
         }
         signedRelease {
             initWith release
diff --git a/application/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.kt b/application/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.kt
index a64a28b01..352622b1e 100644
--- a/application/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/widget/VLCAppWidgetProvider.kt
@@ -61,7 +61,7 @@ abstract class VLCAppWidgetProvider : AppWidgetProvider() {
         onReceive(context, Intent(ACTION_WIDGET_INIT))
 
         /* ask a refresh from the service if there is one */
-        context.sendBroadcast(Intent(ACTION_WIDGET_INIT).setPackage(BuildConfig.APPLICATION_ID))
+        context.sendBroadcast(Intent(ACTION_WIDGET_INIT).setPackage(BuildConfig.APP_ID))
     }
 
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@@ -72,7 +72,7 @@ abstract class VLCAppWidgetProvider : AppWidgetProvider() {
             return
         }
 
-        val views = RemoteViews(BuildConfig.APPLICATION_ID, getlayout())
+        val views = RemoteViews(BuildConfig.APP_ID, getlayout())
         val partial = ACTION_WIDGET_INIT != action
 
         if (!partial) {



More information about the Android mailing list