Alex Sakhartchouk | 6b5222d | 2010-12-13 14:48:21 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 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 | |
Alex Sakhartchouk | c29a444 | 2011-02-22 10:30:32 -0800 | [diff] [blame] | 17 | package com.android.perftest; |
Alex Sakhartchouk | 6b5222d | 2010-12-13 14:48:21 -0800 | [diff] [blame] | 18 | |
| 19 | import android.renderscript.RSSurfaceView; |
| 20 | import android.renderscript.RenderScript; |
| 21 | |
| 22 | import android.app.Activity; |
| 23 | import android.content.res.Configuration; |
| 24 | import android.os.Bundle; |
| 25 | import android.os.Handler; |
| 26 | import android.os.Looper; |
| 27 | import android.os.Message; |
| 28 | import android.provider.Settings.System; |
| 29 | import android.util.Config; |
| 30 | import android.util.Log; |
| 31 | import android.view.Menu; |
| 32 | import android.view.MenuItem; |
| 33 | import android.view.View; |
| 34 | import android.view.Window; |
| 35 | import android.widget.Button; |
| 36 | import android.widget.ListView; |
| 37 | |
| 38 | import java.lang.Runtime; |
| 39 | |
| 40 | public class RsBench extends Activity { |
| 41 | |
| 42 | private RsBenchView mView; |
| 43 | |
| 44 | @Override |
| 45 | public void onCreate(Bundle icicle) { |
| 46 | super.onCreate(icicle); |
| 47 | |
| 48 | // Create our Preview view and set it as the content of our |
| 49 | // Activity |
| 50 | mView = new RsBenchView(this); |
| 51 | setContentView(mView); |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | protected void onResume() { |
| 56 | // Ideally a game should implement onResume() and onPause() |
Alex Sakhartchouk | 0857196 | 2010-12-15 09:59:58 -0800 | [diff] [blame] | 57 | // to take appropriate action when the activity loses focus |
Alex Sakhartchouk | 6b5222d | 2010-12-13 14:48:21 -0800 | [diff] [blame] | 58 | super.onResume(); |
| 59 | mView.resume(); |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | protected void onPause() { |
| 64 | // Ideally a game should implement onResume() and onPause() |
Alex Sakhartchouk | 0857196 | 2010-12-15 09:59:58 -0800 | [diff] [blame] | 65 | // to take appropriate action when the activity loses focus |
Alex Sakhartchouk | 6b5222d | 2010-12-13 14:48:21 -0800 | [diff] [blame] | 66 | super.onPause(); |
| 67 | mView.pause(); |
| 68 | } |
| 69 | |
| 70 | } |
| 71 | |