1 /* 2 * Copyright (C) 2014 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.security.cts; 18 19 import junit.framework.TestCase; 20 21 public class AudioPolicyBinderTest extends TestCase { 22 23 static { 24 System.loadLibrary("ctssecurity_jni"); 25 } 26 27 /** 28 * Checks that IAudioPolicyService::startOutput() cannot be called with an 29 * invalid stream type. 30 */ test_startOutput()31 public void test_startOutput() throws Exception { 32 assertTrue(native_test_startOutput()); 33 } 34 35 /** 36 * Checks that IAudioPolicyService::stopOutput() cannot be called with an 37 * invalid stream type. 38 */ test_stopOutput()39 public void test_stopOutput() throws Exception { 40 assertTrue(native_test_stopOutput()); 41 } 42 43 /** 44 * Checks that IAudioPolicyService::isStreamActive() cannot be called with an 45 * invalid stream type. 46 */ test_isStreamActive()47 public void test_isStreamActive() throws Exception { 48 assertTrue(native_test_isStreamActive()); 49 } 50 51 /** 52 * Checks that IAudioPolicyService::isStreamActiveRemotely() cannot be called with an 53 * invalid stream type. 54 */ test_isStreamActiveRemotely()55 public void test_isStreamActiveRemotely() throws Exception { 56 assertTrue(native_test_isStreamActiveRemotely()); 57 } 58 native_test_startOutput()59 private static native boolean native_test_startOutput(); native_test_stopOutput()60 private static native boolean native_test_stopOutput(); native_test_isStreamActive()61 private static native boolean native_test_isStreamActive(); native_test_isStreamActiveRemotely()62 private static native boolean native_test_isStreamActiveRemotely(); 63 } 64