Example #1
0
 static void a(ApplicationMetadata applicationMetadata, Parcel parcel, int n) {
   int n2 = b.D(parcel);
   b.c(parcel, 1, applicationMetadata.getVersionCode());
   b.a(parcel, 2, applicationMetadata.getApplicationId(), false);
   b.a(parcel, 3, applicationMetadata.getName(), false);
   b.c(parcel, 4, applicationMetadata.getImages(), false);
   b.b(parcel, 5, applicationMetadata.EB, false);
   b.a(parcel, 6, applicationMetadata.getSenderAppIdentifier(), false);
   b.a(parcel, 7, applicationMetadata.fu(), n, false);
   b.H(parcel, n2);
 }
Example #2
0
  @Override
  public CastSessionInfo getSessionInfo() {
    if (isApiClientInvalid()) return null;

    CastSessionInfo.VolumeInfo.Builder volumeBuilder =
        new CastSessionInfo.VolumeInfo.Builder()
            .setLevel(Cast.CastApi.getVolume(mApiClient))
            .setMuted(Cast.CastApi.isMute(mApiClient));

    CastSessionInfo.ReceiverInfo.Builder receiverBuilder =
        new CastSessionInfo.ReceiverInfo.Builder()
            .setLabel(mCastDevice.getDeviceId())
            .setFriendlyName(mCastDevice.getFriendlyName())
            .setVolume(volumeBuilder.build())
            .setIsActiveInput(Cast.CastApi.getActiveInputState(mApiClient))
            .setDisplayStatus(null)
            .setReceiverType("cast")
            .addCapabilities(getCapabilities(mCastDevice));

    CastSessionInfo.Builder sessionInfoBuilder =
        new CastSessionInfo.Builder()
            .setSessionId(mSessionId)
            .setStatusText(mApplicationStatus)
            .setReceiver(receiverBuilder.build())
            .setStatus("connected")
            .setTransportId("web-4")
            .addNamespaces(mNamespaces);

    if (mApplicationMetadata != null) {
      sessionInfoBuilder
          .setAppId(mApplicationMetadata.getApplicationId())
          .setDisplayName(mApplicationMetadata.getName());
    } else {
      sessionInfoBuilder
          .setAppId(mSource.getApplicationId())
          .setDisplayName(mCastDevice.getFriendlyName());
    }

    return sessionInfoBuilder.build();
  }