[libbluray-devel] org.dvb.application: improve compatibility

hpi1 git at videolan.org
Wed Apr 13 10:35:42 CEST 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Apr  7 10:12:55 2016 +0300| [f558e3359a3c85db8fc5a7f329f6f98adc32783b] | committer: hpi1

org.dvb.application: improve compatibility

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=f558e3359a3c85db8fc5a7f329f6f98adc32783b
---

 src/libbluray/bdj/java/org/dvb/application/AppID.java      |   12 +++---------
 src/libbluray/bdj/java/org/dvb/application/AppProxy.java   |    1 -
 .../bdj/java/org/dvb/application/AppStateChangeEvent.java  |   12 ++++++++----
 .../java/org/dvb/application/AppsControlPermission.java    |    6 +++---
 .../bdj/java/org/dvb/application/AppsDatabaseEvent.java    |    4 ++++
 .../bdj/java/org/dvb/application/CurrentServiceFilter.java |    5 ++++-
 6 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/src/libbluray/bdj/java/org/dvb/application/AppID.java b/src/libbluray/bdj/java/org/dvb/application/AppID.java
index 48bb2d9..df6eeda 100644
--- a/src/libbluray/bdj/java/org/dvb/application/AppID.java
+++ b/src/libbluray/bdj/java/org/dvb/application/AppID.java
@@ -48,11 +48,7 @@ public class AppID implements Serializable {
     }
 
     public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
+        if (!(obj instanceof AppID))
             return false;
         AppID other = (AppID) obj;
         if (aid != other.aid)
@@ -62,8 +58,6 @@ public class AppID implements Serializable {
         return true;
     }
 
-    int oid;
-    int aid;
-
-    private static final long serialVersionUID = 1;
+    private int oid;
+    private int aid;
 }
diff --git a/src/libbluray/bdj/java/org/dvb/application/AppProxy.java b/src/libbluray/bdj/java/org/dvb/application/AppProxy.java
index 85993f3..df98a0d 100644
--- a/src/libbluray/bdj/java/org/dvb/application/AppProxy.java
+++ b/src/libbluray/bdj/java/org/dvb/application/AppProxy.java
@@ -43,5 +43,4 @@ public interface AppProxy {
 
     public void removeAppStateChangeEventListener(
             AppStateChangeEventListener listener);
-
 }
diff --git a/src/libbluray/bdj/java/org/dvb/application/AppStateChangeEvent.java b/src/libbluray/bdj/java/org/dvb/application/AppStateChangeEvent.java
index 5d33cb3..1e601bb 100644
--- a/src/libbluray/bdj/java/org/dvb/application/AppStateChangeEvent.java
+++ b/src/libbluray/bdj/java/org/dvb/application/AppStateChangeEvent.java
@@ -48,9 +48,13 @@ public class AppStateChangeEvent extends EventObject {
         return hasFailed;
     }
 
-    private AppID appid;
-    private int fromstate;
-    private int tostate;
-    private boolean hasFailed;
+    public String toString() {
+        return getClass().getName() + "[source=" + source + ",appid=" + appid + ",fromstate=" + fromstate + ",tostate=" + tostate + ",hasFailed=" + hasFailed + "]";
+    }
+
+    private final AppID appid;
+    private final int fromstate;
+    private final int tostate;
+    private final boolean hasFailed;
     private static final long serialVersionUID = -5634352176873439145L;
 }
diff --git a/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java b/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java
index 7fb1f62..ab520f9 100644
--- a/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java
+++ b/src/libbluray/bdj/java/org/dvb/application/AppsControlPermission.java
@@ -24,11 +24,11 @@ import java.security.Permission;
 
 public final class AppsControlPermission extends BasicPermission {
     public AppsControlPermission() {
-        super("toto");
+        super("*");
     }
 
     public AppsControlPermission(String name, String actions) {
-        super(name);
+        super("*");
     }
 
     public String getActions() {
@@ -45,7 +45,7 @@ public final class AppsControlPermission extends BasicPermission {
     }
 
     public int hashCode() {
-        return getClass().hashCode();
+        return 0;
     }
 
     private static final long serialVersionUID = 4003360685455291075L;
diff --git a/src/libbluray/bdj/java/org/dvb/application/AppsDatabaseEvent.java b/src/libbluray/bdj/java/org/dvb/application/AppsDatabaseEvent.java
index cdb6f14..beb39f8 100644
--- a/src/libbluray/bdj/java/org/dvb/application/AppsDatabaseEvent.java
+++ b/src/libbluray/bdj/java/org/dvb/application/AppsDatabaseEvent.java
@@ -37,6 +37,10 @@ public class AppsDatabaseEvent extends EventObject {
         return id;
     }
 
+    public String toString() {
+        return getClass().getName() + "[source=" + source + ",id=" + id + ",appid" + appid + "]";
+    }
+
     static public final int NEW_DATABASE = 0;
     static public final int APP_CHANGED = 1;
     static public final int APP_ADDED = 2;
diff --git a/src/libbluray/bdj/java/org/dvb/application/CurrentServiceFilter.java b/src/libbluray/bdj/java/org/dvb/application/CurrentServiceFilter.java
index ea4b6ab..c6393f6 100644
--- a/src/libbluray/bdj/java/org/dvb/application/CurrentServiceFilter.java
+++ b/src/libbluray/bdj/java/org/dvb/application/CurrentServiceFilter.java
@@ -20,11 +20,14 @@
 package org.dvb.application;
 
 public class CurrentServiceFilter extends AppsDatabaseFilter {
+
+    private final AppsDatabase db = AppsDatabase.getAppsDatabase();
+
     public CurrentServiceFilter() {
         super();
     }
 
     public boolean accept(AppID appid) {
-        return true;
+        return db.getAppProxy(appid) != null;
     }
 }



More information about the libbluray-devel mailing list