pull/123/head
FongMi 3 years ago
parent 8d299559fb
commit 658ba63d6c
  1. 11
      app/src/main/java/com/fongmi/android/tv/player/source/Force.java
  2. 9
      forcetech/src/main/java/com/forcetech/Util.java

@ -72,19 +72,12 @@ public class Force {
private final ServiceConnection mConn = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
set.add(get(name));
set.add(Util.trans(name));
}
@Override
public void onServiceDisconnected(ComponentName name) {
set.remove(get(name));
}
private String get(ComponentName o) {
String name = o.getClassName().toLowerCase();
name = name.substring(name.lastIndexOf(".") + 1);
name = name.replace("service", "");
return name;
set.remove(Util.trans(name));
}
};
}

@ -1,5 +1,6 @@
package com.forcetech;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@ -38,6 +39,14 @@ public class Util {
return "lib" + scheme(url) + ".so";
}
public static String trans(ComponentName o) {
String name = o.getClassName();
name = name.substring(name.lastIndexOf(".") + 1);
name = name.replace("Service", "");
name = name.replace("MainActivity", "mitv");
return name.toLowerCase();
}
public static Intent intent(Context context, String url, File file) {
Intent intent = new Intent(context, clz(url));
intent.putExtra("path", file.getAbsolutePath());

Loading…
Cancel
Save