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