From 945c5c8e9a39e31a71c5c0a9149bd8aa95f7d20a Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 20 Nov 2018 10:49:21 +0100 Subject: [PATCH] adding some Dialer call related things that might be needed soon --- app/src/main/AndroidManifest.xml | 10 ++++++++++ .../contacts/pro/activities/DialpadActivity.kt | 1 + .../pro/helpers/MyConnectionService.kt | 10 ++++++++++ .../pro/helpers/MyPhoneStateListener.kt | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyConnectionService.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyPhoneStateListener.kt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index aee92e80..6a0934d2 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ android:installLocation="auto"> + @@ -216,6 +217,15 @@ android:resource="@xml/provider_paths"/> + + + + + + () + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_dialpad) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyConnectionService.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyConnectionService.kt new file mode 100644 index 00000000..466b2a9f --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyConnectionService.kt @@ -0,0 +1,10 @@ +package com.simplemobiletools.contacts.pro.helpers + +import android.annotation.TargetApi +import android.os.Build +import android.telecom.ConnectionService + +@TargetApi(Build.VERSION_CODES.M) +class MyConnectionService : ConnectionService() { + +} diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyPhoneStateListener.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyPhoneStateListener.kt new file mode 100644 index 00000000..cd8bbb1d --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/MyPhoneStateListener.kt @@ -0,0 +1,18 @@ +package com.simplemobiletools.contacts.pro.helpers + +import android.telephony.PhoneStateListener +import android.telephony.TelephonyManager + +class MyPhoneStateListener : PhoneStateListener() { + override fun onCallStateChanged(state: Int, phoneNumber: String?) { + super.onCallStateChanged(state, phoneNumber) + when (state) { + TelephonyManager.CALL_STATE_IDLE -> { + } + TelephonyManager.CALL_STATE_RINGING -> { + } + TelephonyManager.CALL_STATE_OFFHOOK -> { + } + } + } +}