1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.platform.test.helpers; 18 19 import android.content.pm.PackageManager.NameNotFoundException; 20 21 public interface IStandardAppHelper { 22 23 /** 24 * Setup expectation: On the launcher home screen. 25 * 26 * Launches the desired application. 27 */ open()28 abstract void open(); 29 30 /** 31 * Setup expectation: None 32 * 33 * Presses back until the launcher package is visible, i.e. the home screen. This can be 34 * overriden for custom functionality, however consider and document the exit state if doing so. 35 */ exit()36 abstract void exit(); 37 38 /** 39 * Setup expectations: This application is on the initial launch screen. 40 * 41 * This method will dismiss all visible relevant dialogs and block until this process is 42 * complete. 43 */ dismissInitialDialogs()44 abstract void dismissInitialDialogs(); 45 46 /** 47 * Setup expectations: None 48 * 49 * @return the package name for this helper's application. 50 */ getPackage()51 abstract String getPackage(); 52 53 /** 54 * Setup expectations: None. 55 * 56 * @return the name for this application in the launcher. 57 */ getLauncherName()58 abstract String getLauncherName(); 59 60 /** 61 * Setup expectations: None 62 * 63 * This method will return the version String from PackageManager. 64 * @param pkgName the application package 65 * @throws NameNotFoundException if the package is not found in PM 66 * @return the version as a String 67 */ getVersion()68 abstract String getVersion() throws NameNotFoundException; 69 } 70