1 /* 2 * Copyright (C) 2009 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 package android.media.cts; 17 18 import android.media.cts.R; 19 20 import android.app.Activity; 21 import android.os.Bundle; 22 import android.util.Log; 23 import android.view.SurfaceHolder; 24 import android.view.SurfaceView; 25 import android.view.WindowManager; 26 27 public class MediaStubActivity extends Activity { 28 private static final String TAG = "MediaStubActivity"; 29 private SurfaceHolder mHolder; 30 private SurfaceHolder mHolder2; 31 32 @Override onCreate(Bundle savedInstanceState)33 protected void onCreate(Bundle savedInstanceState) { 34 super.onCreate(savedInstanceState); 35 36 getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 37 setTurnScreenOn(true); 38 setShowWhenLocked(true); 39 40 setContentView(R.layout.mediaplayer); 41 42 SurfaceView surfaceV = (SurfaceView)findViewById(R.id.surface); 43 mHolder = surfaceV.getHolder(); 44 45 SurfaceView surfaceV2 = (SurfaceView)findViewById(R.id.surface2); 46 mHolder2 = surfaceV2.getHolder(); 47 } 48 49 @Override onResume()50 protected void onResume() { 51 Log.i(TAG, "onResume"); 52 super.onResume(); 53 } 54 55 @Override onPause()56 protected void onPause() { 57 Log.i(TAG, "onPause"); 58 super.onPause(); 59 } getSurfaceHolder()60 public SurfaceHolder getSurfaceHolder() { 61 return mHolder; 62 } 63 getSurfaceHolder2()64 public SurfaceHolder getSurfaceHolder2() { 65 return mHolder2; 66 } 67 } 68