Add exception handling in abstract fit helper
Refer ag/1584109 for the implementation for wear
Change-Id: Ic5bba638b069d01477d24d1253d3b10dac1f7d63
diff --git a/libraries/base-app-helpers/src/android/platform/test/helpers/AbstractGoogleFitHelper.java b/libraries/base-app-helpers/src/android/platform/test/helpers/AbstractGoogleFitHelper.java
index 2ee1a58..df2e9a7 100644
--- a/libraries/base-app-helpers/src/android/platform/test/helpers/AbstractGoogleFitHelper.java
+++ b/libraries/base-app-helpers/src/android/platform/test/helpers/AbstractGoogleFitHelper.java
@@ -16,6 +16,8 @@
package android.platform.test.helpers;
+import java.io.IOException;
+
import android.app.Instrumentation;
import android.support.test.uiautomator.Direction;
@@ -65,15 +67,16 @@
* @param steps value of Steps
* @param distance value of Distance in mile
*/
- public abstract void addActivity(String activity, int duration,
- int calories, int steps, int distance);
+ public abstract void addActivity(String activity, int duration, int calories,
+ int steps, int distance);
/**
* Setup expectations: Google Fit is open and idle on the home page or timeline page.
*
* This method will select an activity type and start an activity session
* @param activity case-insensitive activity types, like: running, biking, walking
*/
- public abstract void startActivity(String activity);
+ public abstract void startActivity(String activity) throws IOException;
+
/**
* Setup expectations: An activity session is started.
*
@@ -94,4 +97,12 @@
* This method will terminate and save the current activity and end on the activity summary page
*/
public abstract void saveActivity();
+
+ /**
+ * Setup expectations: An activity session is started.
+ *
+ * This method will stop the current activity and end on the activity page.
+ */
+ public abstract void stopActivity() throws IOException;
+
}