1 /* 2 * Copyright (C) 2015 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.cts.util; 18 19 import android.app.Activity; 20 import android.content.Intent; 21 import android.content.ComponentName; 22 import android.os.Bundle; 23 import android.util.Log; 24 25 import android.cts.util.BroadcastUtils; 26 27 public class BroadcastTestStartActivity extends Activity { 28 static final String TAG = "BroadcastTestStartActivity"; 29 30 @Override onCreate(Bundle savedInstanceState)31 public void onCreate(Bundle savedInstanceState) { 32 super.onCreate(savedInstanceState); 33 Log.i(TAG, " in onCreate"); 34 } 35 36 @Override onResume()37 protected void onResume() { 38 super.onResume(); 39 Log.i(TAG, " in onResume"); 40 } 41 startTest(String testCaseType, String pkg, String cls)42 void startTest(String testCaseType, String pkg, String cls) { 43 Intent intent = new Intent(); 44 Log.i(TAG, "received_testcasetype = " + testCaseType); 45 intent.putExtra(BroadcastUtils.TESTCASE_TYPE, testCaseType); 46 intent.setAction("android.intent.action.VIMAIN_" + testCaseType); 47 intent.setComponent(new ComponentName(pkg, cls)); 48 startActivity(intent); 49 } 50 51 @Override onPause()52 protected void onPause() { 53 Log.i(TAG, " in onPause"); 54 super.onPause(); 55 } 56 57 @Override onStart()58 protected void onStart() { 59 super.onStart(); 60 Log.i(TAG, " in onStart"); 61 } 62 63 @Override onRestart()64 protected void onRestart() { 65 super.onRestart(); 66 Log.i(TAG, " in onRestart"); 67 } 68 69 @Override onStop()70 protected void onStop() { 71 Log.i(TAG, " in onStop"); 72 super.onStop(); 73 } 74 75 @Override onDestroy()76 protected void onDestroy() { 77 Log.i(TAG, " in onDestroy"); 78 super.onDestroy(); 79 } 80 } 81