1 /* 2 * Copyright (C) 2022 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 com.android.cts.verifier; 18 19 import com.android.compatibility.common.util.ApiTest; 20 import com.android.interactive.annotations.Interactive; 21 import com.android.interactive.annotations.SupportMultiDisplayMode; 22 import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; 23 24 import org.junit.Test; 25 import org.junit.runner.RunWith; 26 27 @RunWith(DeviceJUnit4ClassRunner.class) 28 public final class TelephonyTest extends CtsVerifierTest { 29 30 @Interactive 31 @Test 32 @SupportMultiDisplayMode 33 // MultiDisplayMode 34 @ApiTest(apis = "android.telephony.TelephonyManager#ACTION_SHOW_VOICEMAIL_NOTIFICATION") VoicemailBroadcastTest()35 public void VoicemailBroadcastTest() throws Exception { 36 requireFeatures("android.hardware.telephony"); 37 38 runTest(".voicemail.VoicemailBroadcastActivity", "config_voice_capable"); 39 } 40 41 @Interactive 42 @Test 43 @SupportMultiDisplayMode 44 // MultiDisplayMode 45 @ApiTest(apis = "android.telephony.TelephonyManager#ACTION_SHOW_VOICEMAIL_NOTIFICATION") VisualVoicemailServiceTest()46 public void VisualVoicemailServiceTest() throws Exception { 47 requireFeatures("android.hardware.telephony"); 48 49 runTest(".voicemail.VisualVoicemailServiceActivity", "config_voice_capable"); 50 } 51 52 @Interactive 53 @Test 54 @SupportMultiDisplayMode 55 // MultiDisplayMode DialerIncomingCallTest()56 public void DialerIncomingCallTest() throws Exception { // Needs to receive a call 57 requireFeatures("android.hardware.telephony"); 58 59 runTest(".dialer.DialerIncomingCallTestActivity", "config_voice_capable"); 60 } 61 62 @Interactive 63 @Test 64 @SupportMultiDisplayMode 65 // MultiDisplayMode DialerShowsHunOnIncomingCallTest()66 public void DialerShowsHunOnIncomingCallTest() throws Exception { 67 requireFeatures("android.hardware.telephony"); 68 69 runTest(".dialer.DialerShowsHunOnIncomingCallActivity", "config_voice_capable"); 70 } 71 72 @Interactive 73 @Test 74 @SupportMultiDisplayMode 75 // MultiDisplayMode 76 @ApiTest(apis = "android.telephony.TelephonyManager#METADATA_HIDE_VOICEMAIL_SETTINGS_MENU") CallSettingsCheckTest()77 public void CallSettingsCheckTest() throws Exception { 78 requireFeatures("android.hardware.telephony"); 79 80 runTest(".voicemail.CallSettingsCheckActivity", "config_voice_capable"); 81 } 82 83 @Interactive 84 @Test 85 @SupportMultiDisplayMode 86 // MultiDisplayMode 87 @ApiTest(apis = "android.telephony.TelephonyManager#EXTRA_HIDE_PUBLIC_SETTINGS") VoicemailSettingsCheckTest()88 public void VoicemailSettingsCheckTest() throws Exception { 89 requireFeatures("android.hardware.telephony"); 90 91 runTest(".voicemail.VoicemailSettingsCheckActivity", "config_voice_capable"); 92 } 93 94 @Interactive 95 @Test 96 @SupportMultiDisplayMode 97 // MultiDisplayMode DialerImplementsTelecomIntentsTest()98 public void DialerImplementsTelecomIntentsTest() throws Exception { 99 requireFeatures("android.hardware.telephony"); 100 excludeFeatures("android.hardware.type.watch"); 101 102 runTest(".dialer.DialerImplementsTelecomIntentsActivity", "config_voice_capable"); 103 } 104 } 105