adding some Dialer call related things that might be needed soon

This commit is contained in:
tibbi 2018-11-20 10:49:21 +01:00
parent b95a8aec99
commit 945c5c8e9a
4 changed files with 39 additions and 0 deletions

View File

@ -6,6 +6,7 @@
android:installLocation="auto">
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
@ -216,6 +217,15 @@
android:resource="@xml/provider_paths"/>
</provider>
<service
android:name=".helpers.MyConnectionService"
android:label="SimpleContacts ConnectionService"
android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE">
<intent-filter>
<action android:name="android.telecom.ConnectionService"/>
</intent-filter>
</service>
<activity-alias
android:name=".activities.SplashActivity.Red"
android:enabled="false"

View File

@ -23,6 +23,7 @@ import kotlinx.android.synthetic.main.activity_dialpad.*
class DialpadActivity : SimpleActivity() {
var contacts = ArrayList<Contact>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_dialpad)

View File

@ -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() {
}

View File

@ -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 -> {
}
}
}
}