mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-02-23 16:01:09 +01:00
Store deserialized session providers
This commit is contained in:
parent
7e711be919
commit
d70b47c6c3
@ -36,6 +36,7 @@ import com.google.android.gms.dynamic.IObjectWrapper;
|
|||||||
import com.google.android.gms.dynamic.ObjectWrapper;
|
import com.google.android.gms.dynamic.ObjectWrapper;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class CastContextImpl extends ICastContext.Stub {
|
public class CastContextImpl extends ICastContext.Stub {
|
||||||
private static final String TAG = CastContextImpl.class.getSimpleName();
|
private static final String TAG = CastContextImpl.class.getSimpleName();
|
||||||
@ -46,7 +47,7 @@ public class CastContextImpl extends ICastContext.Stub {
|
|||||||
private Context context;
|
private Context context;
|
||||||
private CastOptions options;
|
private CastOptions options;
|
||||||
private IMediaRouter router;
|
private IMediaRouter router;
|
||||||
private Map<String, IBinder> sessionProviders;
|
private Map<String, ISessionProvider> sessionProviders = new HashMap<String, ISessionProvider>();
|
||||||
public ISessionProvider defaultSessionProvider;
|
public ISessionProvider defaultSessionProvider;
|
||||||
|
|
||||||
private MediaRouteSelector mergedSelector;
|
private MediaRouteSelector mergedSelector;
|
||||||
@ -55,17 +56,20 @@ public class CastContextImpl extends ICastContext.Stub {
|
|||||||
this.context = (Context) ObjectWrapper.unwrap(context);
|
this.context = (Context) ObjectWrapper.unwrap(context);
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.router = router;
|
this.router = router;
|
||||||
this.sessionProviders = sessionProviders;
|
for (Map.Entry<String, IBinder> entry : sessionProviders.entrySet()) {
|
||||||
|
this.sessionProviders.put(entry.getKey(), ISessionProvider.Stub.asInterface(entry.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
String receiverApplicationId = options.getReceiverApplicationId();
|
String receiverApplicationId = options.getReceiverApplicationId();
|
||||||
String defaultCategory = CastMediaControlIntent.categoryForCast(receiverApplicationId);
|
String defaultCategory = CastMediaControlIntent.categoryForCast(receiverApplicationId);
|
||||||
|
|
||||||
this.defaultSessionProvider = ISessionProvider.Stub.asInterface(this.sessionProviders.get(defaultCategory));
|
this.defaultSessionProvider = this.sessionProviders.get(defaultCategory);
|
||||||
|
|
||||||
// TODO: This should incorporate passed options
|
// TODO: This should incorporate passed options
|
||||||
this.mergedSelector = new MediaRouteSelector.Builder()
|
this.mergedSelector = new MediaRouteSelector.Builder()
|
||||||
.addControlCategory(MediaControlIntent.CATEGORY_LIVE_VIDEO)
|
.addControlCategory(MediaControlIntent.CATEGORY_LIVE_VIDEO)
|
||||||
.addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
|
.addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)
|
||||||
|
.addControlCategory(defaultCategory)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// TODO: Find a home for this once the rest of the implementation
|
// TODO: Find a home for this once the rest of the implementation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user