1 /* 2 * Copyright (C) 2019 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.helpers; 18 19 /** 20 * Helper class for functional tests of date & time 21 */ 22 23 import java.time.LocalDate; 24 25 public interface IAutoDateTimeSettingsHelper extends IAppHelper { 26 /** 27 * Setup expectation: Date & time setting is open 28 * 29 * <p>Set the device date. 30 * 31 * @param date - input LocalDate object 32 */ setDate(LocalDate date)33 void setDate(LocalDate date); 34 35 /** 36 * Setup expectation: Date & time setting is open 37 * 38 * <p>Get the current date displayed on the UI in LocalDate object. 39 */ getDate()40 LocalDate getDate(); 41 42 /** 43 * Setup expectation: Date & time setting is open 44 * 45 * <p>Set the device time in 12-hour format 46 * 47 * @param hour - input hour 48 * @param minute - input minute 49 * @param is_am - input am/pm 50 */ setTimeInTwelveHourFormat(int hour, int minute, boolean is_am)51 void setTimeInTwelveHourFormat(int hour, int minute, boolean is_am); 52 53 /** 54 * Setup expectation: Date & time setting is open 55 * 56 * <p>Set the device time in 24-hour format 57 * 58 * @param hour - input hour 59 * @param minute - input minute 60 */ setTimeInTwentyFourHourFormat(int hour, int minute)61 void setTimeInTwentyFourHourFormat(int hour, int minute); 62 63 /** 64 * Setup expectation: Date & time setting is open 65 * 66 * <p>Get the current time displayed on the UI. 67 * 68 * @return returned time format will match the UI format exactly 69 */ getTime()70 String getTime(); 71 72 /** 73 * Setup expectation: Date & time setting is open 74 * 75 * <p>Set the device time zone. 76 * 77 * @param timezone - city selected for timezone 78 */ setTimeZone(String timezone)79 void setTimeZone(String timezone); 80 81 /** 82 * Setup expectation: Date & time setting is open 83 * 84 * <p>Get the current timezone displayed on the UI. 85 */ getTimeZone()86 String getTimeZone(); 87 88 /** 89 * Setup expectation: Date & time setting is open 90 * 91 * <p>Check if the 24 hour format is enabled 92 */ isTwentyFourHourFormatEnabled()93 boolean isTwentyFourHourFormatEnabled(); 94 95 /** 96 * Setup expectation: Date & time setting is open 97 * 98 * <p>Toggle on/off 24 hour format widget switch. 99 */ toggleTwentyFourHourFormatSwitch()100 boolean toggleTwentyFourHourFormatSwitch(); 101 } 102