[Android] Disable crash reporter when app is not beta

Nicolas Pomepuy git at videolan.org
Wed Aug 7 14:08:59 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Aug  7 10:26:34 2019 +0200| [06adb0f74d5b41b6c5ac1085b1a5a5bbfeddacc1] | committer: Geoffrey Métais

Disable crash reporter when app is not beta

> https://code.videolan.org/videolan/vlc-android/commit/06adb0f74d5b41b6c5ac1085b1a5a5bbfeddacc1
---

 vlc-android/src/org/videolan/vlc/VLCApplication.kt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.kt b/vlc-android/src/org/videolan/vlc/VLCApplication.kt
index 11193562b..0c77d8449 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.kt
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.kt
@@ -22,8 +22,10 @@ package org.videolan.vlc
 import android.annotation.SuppressLint
 import android.annotation.TargetApi
 import android.app.Application
+import android.content.ComponentName
 import android.content.Context
 import android.content.Intent
+import android.content.pm.PackageManager
 import android.content.res.Configuration
 import android.content.res.Resources
 import android.os.Build
@@ -39,6 +41,7 @@ import kotlinx.coroutines.ObsoleteCoroutinesApi
 import org.videolan.libvlc.Dialog
 import org.videolan.libvlc.util.AndroidUtil
 import org.videolan.vlc.gui.DialogActivity
+import org.videolan.vlc.gui.SendCrashActivity
 import org.videolan.vlc.gui.dialogs.VlcProgressDialog
 import org.videolan.vlc.gui.helpers.AudioUtil
 import org.videolan.vlc.gui.helpers.BitmapCache
@@ -109,6 +112,8 @@ class VLCApplication : MultiDexApplication() {
                 if (!VLCInstance.testCompatibleCPU(appContext)) return at Runnable
                 Dialog.setCallbacks(VLCInstance[instance], dialogCallbacks)
             })
+            packageManager.setComponentEnabledSetting(ComponentName(this, SendCrashActivity::class.java),
+                    if (resources.getBoolean(R.bool.is_beta)) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP)
         }).start()
     }
 



More information about the Android mailing list