ManagerService.java revision 7ddc0b7a72aa66d699fecce3d855a6c70f844647
1/* 2 * Copyright (C) 2010 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 17package com.android.dumprendertree2; 18 19import android.app.Service; 20import android.content.Intent; 21import android.os.Handler; 22import android.os.IBinder; 23import android.os.Message; 24import android.os.Messenger; 25import android.util.Log; 26 27/** 28 * A service that handles managing the results of tests, informing of crashes, generating 29 * summaries, etc. 30 */ 31public class ManagerService extends Service { 32 33 private static final String LOG_TAG = "ManagerService"; 34 35 static final int MSG_PROCESS_ACTUAL_RESULTS = 0; 36 37 private Handler mIncomingHandler = new Handler() { 38 @Override 39 public void handleMessage(Message msg) { 40 switch (msg.what) { 41 case MSG_PROCESS_ACTUAL_RESULTS: 42 Log.d(LOG_TAG + ".mIncomingHandler", msg.getData().getString("relativePath")); 43 break; 44 } 45 } 46 }; 47 48 private Messenger mMessenger = new Messenger(mIncomingHandler); 49 50 @Override 51 public void onCreate() { 52 super.onCreate(); 53 /** TODO: */ 54 } 55 56 @Override 57 public IBinder onBind(Intent intent) { 58 return mMessenger.getBinder(); 59 } 60}