public void RemoveUpdates()
        {
            Task task = null;

            switch (requestType)
            {
            case CALLBACK:
                task = mFusedLocationProviderClient.removeLocationUpdates(mLocationCallback);
                break;

            case INTENT:
                task = mFusedLocationProviderClient.removeLocationUpdates(LocationCommon.GetPendingIntent());
                break;

            case LocationHD:
                task = mFusedLocationProviderClient.removeLocationUpdates(mLocationCallback);
                break;
            }

            if (task != null)
            {
                task.addOnSuccessListener(new LocationSuccessListener((AndroidJavaObject o) =>
                {
                    TestTip.Inst.ShowText("remove update success");
                }))
                .addOnFailureListener(new HmsFailureListener((Exception e) =>
                {
                    TestTip.Inst.ShowText("remove update failure");
                }));
            }
        }
 public void RequestActivity()
 {
     LocationBroadcast.SetActivityEnabled(true);
     activityIdentificationService = ActivityIdentification.getService(new UnityPlayerActivity());
     activityIdentificationService.createActivityIdentificationUpdates(5000, LocationCommon.GetPendingIntent())
     .addOnSuccessListener(new LocationSuccessListener((AndroidJavaObject o) => {
         TestTip.Inst.ShowText("activity success");
     }))
     .addOnFailureListener(new HmsFailureListener((Exception e) => {
         TestTip.Inst.ShowText("activity failure");
     }));
 }
 public void SetIntentSuccess()
 {
     mFusedLocationProviderClient
     .requestLocationUpdates(mLocationRequest, LocationCommon.GetPendingIntent())
     .addOnSuccessListener(new LocationSuccessListener((AndroidJavaObject o) =>
     {
         TestTip.Inst.ShowText("set intent success");
     }))
     .addOnFailureListener(new HmsFailureListener((Exception e) =>
     {
         TestTip.Inst.ShowText("set intent fail");
     }));
 }
 public void RemoveRunning()
 {
     LocationBroadcast.SetActivityEnabled(false);
     activityIdentificationService.deleteActivityIdentificationUpdates(LocationCommon.GetPendingIntent());
 }