[Android] Remove dead code

Geoffrey Métais git at videolan.org
Wed Jan 23 18:34:23 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jan 23 15:53:39 2019 +0100| [d59e5071bd608a7999af75cb6581147a71bd1f16] | committer: Geoffrey Métais

Remove dead code

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

 .../videolan/vlc/gui/PlaybackServiceActivity.java  | 32 +-------
 .../videolan/vlc/gui/PlaybackServiceFragment.java  | 93 ----------------------
 .../videolan/vlc/gui/dialogs/PickTimeFragment.java |  5 +-
 3 files changed, 4 insertions(+), 126 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/PlaybackServiceActivity.java b/vlc-android/src/org/videolan/vlc/gui/PlaybackServiceActivity.java
index 06175b4a1..ce9bdc707 100644
--- a/vlc-android/src/org/videolan/vlc/gui/PlaybackServiceActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/PlaybackServiceActivity.java
@@ -23,43 +23,15 @@
 package org.videolan.vlc.gui;
 
 import android.content.Context;
-import androidx.annotation.MainThread;
-import androidx.fragment.app.FragmentActivity;
 
 import org.videolan.vlc.PlaybackService;
 
 import java.util.ArrayList;
 import java.util.List;
 
-public class PlaybackServiceActivity extends FragmentActivity implements PlaybackService.Client.Callback {
-    final private Helper mHelper = new Helper(this, this);
-    protected PlaybackService mService;
-
-    @Override
-    protected void onStart() {
-        super.onStart();
-        mHelper.onStart();
-    }
-
-    @Override
-    protected void onStop() {
-        super.onStop();
-        mHelper.onStop();
-    }
-
-    public Helper getHelper() {
-        return mHelper;
-    }
-
-    @Override
-    public void onConnected(PlaybackService service) {
-        mService = service;
-    }
+import androidx.annotation.MainThread;
 
-    @Override
-    public void onDisconnected() {
-        mService = null;
-    }
+public class PlaybackServiceActivity {
 
     public static class Helper {
         private List<PlaybackService.Client.Callback> mFragmentCallbacks = new ArrayList<PlaybackService.Client.Callback>();
diff --git a/vlc-android/src/org/videolan/vlc/gui/PlaybackServiceFragment.java b/vlc-android/src/org/videolan/vlc/gui/PlaybackServiceFragment.java
deleted file mode 100644
index 25a0ccc44..000000000
--- a/vlc-android/src/org/videolan/vlc/gui/PlaybackServiceFragment.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * *************************************************************************
- *  PlaybackServiceFragment.java
- * **************************************************************************
- *  Copyright © 2015 VLC authors, VideoLAN, and VideoLabs
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *  ***************************************************************************
- */
-
-package org.videolan.vlc.gui;
-
-import android.app.Activity;
-import androidx.fragment.app.Fragment;
-
-import org.videolan.vlc.PlaybackService;
-import org.videolan.vlc.gui.video.VideoPlayerActivity;
-
-public abstract class PlaybackServiceFragment extends Fragment implements PlaybackService.Client.Callback {
-    protected PlaybackService mService;
-
-    public static PlaybackServiceActivity.Helper getHelper(Activity activity) {
-        if (activity == null)
-            return null;
-
-        else if ((activity instanceof PlaybackServiceActivity))
-            return ((PlaybackServiceActivity) activity).getHelper();
-        else if ((activity instanceof VideoPlayerActivity))
-            return ((VideoPlayerActivity) activity).getHelper();
-        else
-            return null;
-    }
-
-    private static void registerPlaybackService(Activity activity, PlaybackService.Client.Callback cb) {
-        final PlaybackServiceActivity.Helper helper = getHelper(activity);
-        if (helper != null)
-            helper.registerFragment(cb);
-    }
-    private static void unregisterPlaybackService(Activity activity, PlaybackService.Client.Callback cb) {
-        final PlaybackServiceActivity.Helper helper = getHelper(activity);
-        if (helper != null)
-            helper.unregisterFragment(cb);
-    }
-
-    public static void registerPlaybackService(Fragment fragment, PlaybackService.Client.Callback cb) {
-        registerPlaybackService(fragment.getActivity(), cb);
-    }
-    public static void registerPlaybackService(android.app.Fragment fragment, PlaybackService.Client.Callback cb) {
-        registerPlaybackService(fragment.getActivity(), cb);
-
-    }
-
-    public static void unregisterPlaybackService(Fragment fragment, PlaybackService.Client.Callback cb) {
-        unregisterPlaybackService(fragment.getActivity(), cb);
-    }
-    public static void unregisterPlaybackService(android.app.Fragment fragment, PlaybackService.Client.Callback cb) {
-        unregisterPlaybackService(fragment.getActivity(), cb);
-    }
-
-    @Override
-    public void onStart(){
-        super.onStart();
-        registerPlaybackService(this, this);
-    }
-
-    @Override
-    public void onStop() {
-        super.onStop();
-        unregisterPlaybackService(this, this);
-    }
-
-    @Override
-    public void onConnected(PlaybackService service) {
-        mService = service;
-    }
-
-    @Override
-    public void onDisconnected() {
-        mService = null;
-    }
-}
diff --git a/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.java b/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.java
index 6b8277d29..704565098 100644
--- a/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/dialogs/PickTimeFragment.java
@@ -23,8 +23,6 @@
 package org.videolan.vlc.gui.dialogs;
 
 import android.os.Bundle;
-import androidx.annotation.Nullable;
-import androidx.fragment.app.DialogFragment;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -34,9 +32,10 @@ import android.widget.TextView;
 import org.videolan.vlc.PlaybackService;
 import org.videolan.vlc.R;
 import org.videolan.vlc.gui.PlaybackServiceActivity;
-import org.videolan.vlc.gui.PlaybackServiceFragment;
 import org.videolan.vlc.gui.helpers.UiTools;
 
+import androidx.annotation.Nullable;
+
 public abstract class PickTimeFragment extends DismissDialogFragment implements View.OnClickListener, View.OnFocusChangeListener,
         PlaybackService.Client.Callback {
 



More information about the Android mailing list