scanActivity_(activity) {
    const sink = this.discoveryService_.getSinkById(activity.route.sinkId);
    if (!sink) {
      this.logger_.warning(
          'Activity refers to nonexistent sink: ' + activity.route.id);
      return Promise.resolve();
    }
    if (!sink.supportsAppAvailability()) {
      return Promise.resolve();
    }
    const appName = activity.appName;
    this.logger_.fine(
        'Querying ' + sink.getId() + ' for ' + appName + ' to update activity');
    return this.getAppInfo_(sink, appName)
        .then(
            appInfo => this.maybeUpdateActivityRecord_(
                /** @type {!DialSink} */ (sink), appName, appInfo),
            e => this.doRemoveActivityRecord_(
                /** @type {!DialSink} */ (sink), appName));
  }
/**
   * Issues an app info query for the given activity's app to the activity's
   * sink, and updates the activity records if the app is no longer running.
   * @param {!mr.dial.Activity} activity
   * @return {!Promise<void>} Resolved when the activity record has possibly
   *     been updated.
   * @private
   */
Issues an app info query for the given activity's app to the activity's
sink, and updates the activity records if the app is no longer running.
@param {!mr.dial.Activity} activity
@return {!Promise} Resolved when the activity record has possibly
been updated.
@private
Issues an app info query for the given activity ' s app to the activity ' s sink and updates the activity records if the app is no longer running . @param { !mr . dial . Activity } activity @return { !Promise } Resolved when the activity record has possibly been updated . @private
scanActivity_(activity) {
    const sink = this.discoveryService_.getSinkById(activity.route.sinkId);
    if (!sink) {
      this.logger_.warning(
          'Activity refers to nonexistent sink: ' + activity.route.id);
      return Promise.resolve();
    }
    if (!sink.supportsAppAvailability()) {
      return Promise.resolve();
    }
    const appName = activity.appName;
    this.logger_.fine(
        'Querying ' + sink.getId() + ' for ' + appName + ' to update activity');
    return this.getAppInfo_(sink, appName)
        .then(
            appInfo => this.maybeUpdateActivityRecord_(
                 (sink), appName, appInfo),
            e => this.doRemoveActivityRecord_(
                 (sink), appName));
  }
scanActivity_ ( activity ) { const sink = this . discoveryService_ . getSinkById ( activity . route . sinkId ) ; if ( ! sink ) { this . logger_ . warning ( 'Activity refers to nonexistent sink: ' + activity . route . id ) ; return Promise . resolve ( ) ; } if ( ! sink . supportsAppAvailability ( ) ) { return Promise . resolve ( ) ; } const appName = activity . appName ; this . logger_ . fine ( 'Querying ' + sink . getId ( ) + ' for ' + appName + ' to update activity' ) ; return this . getAppInfo_ ( sink , appName ) . then ( appInfo => this . maybeUpdateActivityRecord_ ( ( sink ) , appName , appInfo ) , e => this . doRemoveActivityRecord_ ( ( sink ) , appName ) ) ; }
Issues an app info query for the given activity's app to the activity's
 sink, and updates the activity records if the app is no longer running.
Issues an app info query for the given activity ' s app to the activity ' s sink and updates the activity records if the app is no longer running .
/** @type {!DialSink} */ /** @type {!DialSink} */