From b415e4dac14df80fedb73b4be7f72bec455b60b6 Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Fri, 12 Jul 2013 14:17:55 -0700 Subject: Adding skeleton code for InCallUI. Defines a service to communicate with Telephony Service. Change-Id: I633cbdae529ff61989f30cebfac240ce5a895687 --- InCallUI/Android.mk | 15 ++++++ InCallUI/AndroidManifest.xml | 35 +++++++++++++ InCallUI/res/values/strings.xml | 21 ++++++++ .../com/android/incallui/CallMonitorService.java | 60 ++++++++++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 InCallUI/Android.mk create mode 100644 InCallUI/AndroidManifest.xml create mode 100644 InCallUI/res/values/strings.xml create mode 100644 InCallUI/src/com/android/incallui/CallMonitorService.java (limited to 'InCallUI') diff --git a/InCallUI/Android.mk b/InCallUI/Android.mk new file mode 100644 index 000000000..11a315a91 --- /dev/null +++ b/InCallUI/Android.mk @@ -0,0 +1,15 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_STATIC_JAVA_LIBRARIES := com.android.services.telephony.common + +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := InCallUI +LOCAL_CERTIFICATE := platform +LOCAL_PRIVELEGED_MODULE := true + +include $(BUILD_PACKAGE) + +# Build the test package +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/InCallUI/AndroidManifest.xml b/InCallUI/AndroidManifest.xml new file mode 100644 index 000000000..b5c47609a --- /dev/null +++ b/InCallUI/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + diff --git a/InCallUI/res/values/strings.xml b/InCallUI/res/values/strings.xml new file mode 100644 index 000000000..cbf3aea3a --- /dev/null +++ b/InCallUI/res/values/strings.xml @@ -0,0 +1,21 @@ + + + + + + + InCallUI + diff --git a/InCallUI/src/com/android/incallui/CallMonitorService.java b/InCallUI/src/com/android/incallui/CallMonitorService.java new file mode 100644 index 000000000..c1325f8ae --- /dev/null +++ b/InCallUI/src/com/android/incallui/CallMonitorService.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.incallui; + +import android.app.Service; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.Handler; +import android.os.IBinder; +import android.widget.Toast; + +import com.android.services.telephony.common.ICallMonitorService; + +/** + * Service used to listen for call state changes. + */ +public class CallMonitorService extends Service { + + @Override + public void onCreate() { + super.onCreate(); + } + + @Override + public void onDestroy() { + } + + @Override + public IBinder onBind(Intent intent) { + return mBinder; + } + + private final ICallMonitorService.Stub mBinder = new ICallMonitorService.Stub() { + public void onIncomingCall(int callId) { + showAlert("New Call came in: " + callId); + } + }; + + private void showAlert(String message) { + Context context = getApplicationContext(); + int duration = Toast.LENGTH_SHORT; + + Toast.makeText(context, message, duration).show(); + } + } -- cgit v1.2.3