1 /** 2 * Copyright (C) 2022 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 com.android.telephony.testimsmediahal; 18 19 import android.app.Service; 20 import android.content.Intent; 21 import android.hardware.radio.ims.media.IImsMedia; 22 import android.os.IBinder; 23 import android.util.Log; 24 25 /** 26 * Creating ImeMedia service for implementation of ImsMedia HAL APIs. 27 * Service used to have connection with {@link AudioOffloadService}. 28 */ 29 30 public class ImsMediaHALtestService extends Service { 31 private static final String SERVICE_TAG = "ImsMediaHALtestService"; 32 private static IImsMedia.Stub sIImsMediaBinder; 33 getInstance()34 public static IImsMedia.Stub getInstance() { 35 if (sIImsMediaBinder == null) { 36 sIImsMediaBinder = new IImsMediaImpl(); 37 } 38 return sIImsMediaBinder; 39 } 40 41 @Override onCreate()42 public void onCreate() { 43 Log.d(SERVICE_TAG, "onCreate"); 44 45 } 46 47 @Override onBind(Intent intent)48 public IBinder onBind(Intent intent) { 49 Log.d(SERVICE_TAG, Thread.currentThread().getName() + " onBind"); 50 return getInstance(); 51 } 52 53 @Override onDestroy()54 public void onDestroy() { 55 Log.d(SERVICE_TAG, "onDestroy"); 56 } 57 } 58