[Android] Removed intId from extension protocol

David Papazian git at videolan.org
Mon Aug 7 17:55:04 CEST 2017


vlc-android | branch: master | David Papazian <david.papazian at metz.supelec.fr> | Mon Aug  7 13:25:34 2017 +0200| [72c8c17c72d11dd80fccc81fe175fec1829a6205] | committer: Geoffrey Métais

Removed intId from extension protocol

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

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

 .../aidl/org/videolan/vlc/extensions/api/IExtensionService.aidl    | 2 +-
 .../java/org/videolan/vlc/extensions/api/VLCExtensionItem.java     | 7 +------
 .../java/org/videolan/vlc/extensions/api/VLCExtensionService.java  | 7 +++----
 .../src/org/videolan/vlc/extensions/ExtensionManagerService.java   | 6 +++---
 vlc-android/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java | 2 +-
 5 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/api/src/main/aidl/org/videolan/vlc/extensions/api/IExtensionService.aidl b/api/src/main/aidl/org/videolan/vlc/extensions/api/IExtensionService.aidl
index b7d975100..5b7e14b94 100644
--- a/api/src/main/aidl/org/videolan/vlc/extensions/api/IExtensionService.aidl
+++ b/api/src/main/aidl/org/videolan/vlc/extensions/api/IExtensionService.aidl
@@ -6,6 +6,6 @@ import org.videolan.vlc.extensions.api.VLCExtensionItem;
 interface IExtensionService {
     // Protocol version 1
     oneway void onInitialize(int index, in IExtensionHost host);
-    oneway void browse(int intId, String stringId); // longId?
+    oneway void browse(String stringId);
     oneway void refresh();
 }
diff --git a/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionItem.java b/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionItem.java
index fe2b12e7f..fc3752e1d 100644
--- a/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionItem.java
+++ b/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionItem.java
@@ -72,7 +72,6 @@ public class VLCExtensionItem implements Parcelable {
     public static final int TYPE_OTHER_FILE = 5;
 
     public String stringId;
-    public int intId;
 
     public String link;
     public String title;
@@ -86,11 +85,9 @@ public class VLCExtensionItem implements Parcelable {
      * You have to provide a String or int id for browsable elements (with type #TYPE_DIRECTORY)
      *
      * @param stringId The String to use as an ID, set to #null if you prefer to use the #intId
-     * @param intId The int to use as an ID, set to 0 if you prefer to use the #stringId
      */
-    public VLCExtensionItem(String stringId, int intId) {
+    public VLCExtensionItem(String stringId) {
         this.stringId = stringId;
-        this.intId = intId;
     }
 
     public VLCExtensionItem() {}
@@ -205,7 +202,6 @@ public class VLCExtensionItem implements Parcelable {
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeString(stringId);
-        dest.writeInt(intId);
         dest.writeString(link);
         dest.writeString(title);
         dest.writeString(subTitle);
@@ -215,7 +211,6 @@ public class VLCExtensionItem implements Parcelable {
 
     public void readFromParcel(Parcel in) {
         stringId = in.readString();
-        intId = in.readInt();
         link = in.readString();
         title = in.readString();
         subTitle = in.readString();
diff --git a/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionService.java b/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionService.java
index 42e8efc67..b931c8681 100644
--- a/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionService.java
+++ b/api/src/main/java/org/videolan/vlc/extensions/api/VLCExtensionService.java
@@ -56,10 +56,9 @@ public abstract class VLCExtensionService extends Service{
      * Called by VLC when users wants to browse one of your {#link VLCExtensionItem.TYPE_DIRECTORY}
      * VLC provides {#intId} and {#stringId} from chosen item
      *
-     * @param intId int id of the item to browse
      * @param stringId String id of the item to browse
      */
-    protected abstract void browse(int intId, @Nullable String stringId);
+    protected abstract void browse(@Nullable String stringId);
 
     /**
      * Called by VLC when user wants to refresh the current list displayed by the extension.
@@ -144,11 +143,11 @@ public abstract class VLCExtensionService extends Service{
         }
 
         @Override
-        public void browse(final int id, final String text) throws RemoteException {
+        public void browse(final String text) throws RemoteException {
             mServiceHandler.post(new Runnable() {
                 @Override
                 public void run() {
-                    VLCExtensionService.this.browse(id, text);
+                    VLCExtensionService.this.browse(text);
                 }
             });
         }
diff --git a/vlc-android/src/org/videolan/vlc/extensions/ExtensionManagerService.java b/vlc-android/src/org/videolan/vlc/extensions/ExtensionManagerService.java
index 2ae8e411d..96483680a 100644
--- a/vlc-android/src/org/videolan/vlc/extensions/ExtensionManagerService.java
+++ b/vlc-android/src/org/videolan/vlc/extensions/ExtensionManagerService.java
@@ -143,7 +143,7 @@ public class ExtensionManagerService extends Service {
 
     public void openExtension(int index) {
         if (index == mCurrentIndex)
-            browse(0, null);
+            browse(null);
         else
             connectService(index);
 
@@ -210,7 +210,7 @@ public class ExtensionManagerService extends Service {
         } catch (RemoteException e) {}
     }
 
-    public void browse(int intId, String stringId) {
+    public void browse(String stringId) {
         try {
             ExtensionListing extension = mExtensions.get(mCurrentIndex);
             if (extension == null)
@@ -218,7 +218,7 @@ public class ExtensionManagerService extends Service {
             IExtensionService service = extension.getConnection().binder;
             if (service == null)
                 return;
-            service.browse(intId, stringId);
+            service.browse(stringId);
         } catch (RemoteException e) {}
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java b/vlc-android/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java
index e208613f6..dd4a6b1cb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/ExtensionBrowser.java
@@ -146,7 +146,7 @@ public class ExtensionBrowser extends Fragment implements View.OnClickListener,
     }
 
     public void browseItem(VLCExtensionItem item) {
-        mExtensionManagerService.browse(item.intId, item.stringId);
+        mExtensionManagerService.browse(item.stringId);
     }
 
     @Override



More information about the Android mailing list