1 /* 2 * Copyright (C) 2013 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.example.android.smssample.service; 18 19 import android.app.IntentService; 20 import android.content.Intent; 21 import android.telephony.TelephonyManager; 22 23 import com.example.android.smssample.Utils; 24 25 /** 26 * This service handles the system intent ACTION_RESPOND_VIA_MESSAGE when we are the default SMS 27 * app. 28 */ 29 public class RespondService extends IntentService { 30 private static final String TAG = "RespondService"; 31 32 public RespondService() { 33 super(TAG); 34 } 35 36 @Override 37 protected void onHandleIntent(Intent intent) { 38 if (intent != null) { 39 if (Utils.hasJellyBeanMR2() && Utils.isDefaultSmsApp(this) && 40 // ACTION_RESPOND_VIA_MESSAGE was added in JB MR2 41 TelephonyManager.ACTION_RESPOND_VIA_MESSAGE.equals(intent.getAction())) { 42 // TODO: Handle "respond via message" quick reply 43 } 44 } 45 } 46 } 47