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

hpi1 git at videolan.org
Wed Apr 13 10:33:09 CEST 2016


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

org.dvb.application: improve compatibility

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

 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  |    4 ++++
 .../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, 18 insertions(+), 14 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..e934d37 100644
--- a/src/libbluray/bdj/java/org/dvb/application/AppStateChangeEvent.java
+++ b/src/libbluray/bdj/java/org/dvb/application/AppStateChangeEvent.java
@@ -48,6 +48,10 @@ public class AppStateChangeEvent extends EventObject {
         return hasFailed;
     }
 
+    public String toString() {
+        return getClass().getName() + "[source=" + source + ",appid=" + appid + ",fromState=" + fromState + ",toState=" + toState + ",hasFailed=" + hasFailed + "]";
+    }
+
     private AppID appid;
     private int fromstate;
     private int tostate;
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