Exemple #1
0
  private void build() {
    mLogger.d("build");
    mUberRequestHandled = false;
    mLastBuildProgress = 0;
    mInternetConnected = ConnectionState.isConnected();

    if (mLastRouterType == Framework.ROUTER_TYPE_TAXI) {
      if (!mInternetConnected) {
        completeUberRequest();
        return;
      }
      requestUberInfo();
    }

    setBuildState(BuildState.BUILDING);
    updatePlan();

    Statistics.INSTANCE.trackRouteBuild(mLastRouterType, mStartPoint, mEndPoint);
    org.alohalytics.Statistics.logEvent(
        AlohaHelper.ROUTING_BUILD,
        new String[] {
          Statistics.EventParam.FROM, Statistics.getPointType(mStartPoint),
          Statistics.EventParam.TO, Statistics.getPointType(mEndPoint)
        });
    Framework.nativeBuildRoute(
        mStartPoint.getLat(), mStartPoint.getLon(), mEndPoint.getLat(), mEndPoint.getLon());
  }
Exemple #2
0
 /**
  * Called from the native code
  *
  * @param info this object contains information about Uber products
  */
 @MainThread
 private void onUberInfoReceived(@NonNull UberInfo info) {
   mUberPlanning = false;
   mLogger.d("onUberInfoReceived uberInfo = " + info);
   if (mLastRouterType == Framework.ROUTER_TYPE_TAXI && mContainer != null) {
     mContainer.onUberInfoReceived(info);
     completeUberRequest();
   }
 }
Exemple #3
0
 /**
  * Called from the native code
  *
  * @param errorCode must match the one of the values in {@link
  *     com.mapswithme.maps.uber.Uber.ErrorCode}
  */
 @MainThread
 private void onUberError(@NonNull String errorCode) {
   mUberPlanning = false;
   Uber.ErrorCode code = Uber.ErrorCode.valueOf(errorCode);
   mLogger.e("onUberError error = " + code);
   if (mLastRouterType == Framework.ROUTER_TYPE_TAXI && mContainer != null) {
     mContainer.onUberError(code);
     completeUberRequest();
   }
 }