[Android] Disable the quit&restart on Chrome versions

Jean-Baptiste Kempf git at videolan.org
Wed Jun 24 11:01:07 CEST 2015


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Jun 24 10:56:34 2015 +0200| [f8c9a39a919bee0c9f4c26d5c543aabc517b8d5e] | committer: Jean-Baptiste Kempf

Disable the quit&restart on Chrome versions

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

 .../org/videolan/vlc/gui/PreferencesActivity.java  |   22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
index 358c299..d5172a9 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PreferencesActivity.java
@@ -58,6 +58,7 @@ import org.videolan.vlc.util.BitmapCache;
 import org.videolan.vlc.util.Util;
 import org.videolan.vlc.util.VLCInstance;
 import org.videolan.vlc.util.VLCOptions;
+import org.videolan.vlc.BuildConfig;
 
 @SuppressWarnings("deprecation")
 public class PreferencesActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener {
@@ -207,15 +208,18 @@ public class PreferencesActivity extends PreferenceActivity implements OnSharedP
 
         /*** Attach debugging items **/
         Preference quitAppPref = findPreference("quit_app");
-        quitAppPref.setOnPreferenceClickListener(
-                new OnPreferenceClickListener() {
-
-                    @Override
-                    public boolean onPreferenceClick(Preference preference) {
-                        android.os.Process.killProcess(android.os.Process.myPid());
-                        return true;
-                    }
-                });
+        if (BuildConfig.FLAVOR_target != "chrome") {
+            quitAppPref.setOnPreferenceClickListener(
+                    new OnPreferenceClickListener() {
+
+                        @Override
+                        public boolean onPreferenceClick(Preference preference) {
+                            android.os.Process.killProcess(android.os.Process.myPid());
+                            return true;
+                        }
+                    });
+        } else
+            quitAppPref.setEnabled(false);
 
         // Audio output
         ListPreference aoutPref = (ListPreference) findPreference("aout");



More information about the Android mailing list