1 /*------------------------------------------------------------------------- 2 * drawElements Quality Program Tester Core 3 * ---------------------------------------- 4 * 5 * Copyright 2014 The Android Open Source Project 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 *//*! 20 * \file 21 * \brief Background ExecServer starter 22 *//*--------------------------------------------------------------------*/ 23 24 package com.drawelements.deqp.execserver; 25 26 import android.app.Activity; 27 import android.os.Bundle; 28 import com.drawelements.deqp.testercore.Log; 29 import com.drawelements.deqp.execserver.ExecService; 30 import android.content.Intent; 31 32 public class ServiceStarter extends Activity { 33 34 @Override onCreate(Bundle savedInstance)35 public void onCreate(Bundle savedInstance) { 36 super.onCreate(savedInstance); 37 } 38 39 @Override onStart()40 public void onStart() { 41 super.onStart(); 42 43 final int port = getIntent().getIntExtra("port", ExecService.DEFAULT_PORT); 44 45 try { 46 Intent svc = new Intent(this, ExecService.class); 47 svc.putExtra("port", port); 48 startService(svc); 49 } 50 catch (Exception e) { 51 Log.e(ExecService.LOG_TAG, "Failed to start ExecService", e); 52 } 53 finish(); 54 } 55 56 @Override onDestroy()57 protected void onDestroy() { 58 super.onDestroy(); 59 } 60 } 61