mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
Merge pull request #471 from Naveen3Singh/caller_id_perm
Request Caller ID app role on android 10 and above
This commit is contained in:
@@ -62,7 +62,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:5d3439cd6b'
|
implementation 'com.github.SimpleMobileTools:Simple-Commons:449f554c76'
|
||||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||||
implementation 'me.grantland:autofittextview:0.2.1'
|
implementation 'me.grantland:autofittextview:0.2.1'
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.simplemobiletools.dialer.activities
|
package com.simplemobiletools.dialer.activities
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.app.Activity
|
||||||
import android.app.SearchManager
|
import android.app.SearchManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -16,6 +17,7 @@ import android.view.Menu
|
|||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.appcompat.widget.SearchView
|
import androidx.appcompat.widget.SearchView
|
||||||
import androidx.core.view.MenuItemCompat
|
import androidx.core.view.MenuItemCompat
|
||||||
import androidx.viewpager.widget.ViewPager
|
import androidx.viewpager.widget.ViewPager
|
||||||
@@ -83,6 +85,10 @@ class MainActivity : SimpleActivity() {
|
|||||||
launchSetDefaultDialerIntent()
|
launchSetDefaultDialerIntent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isQPlus() && config.blockUnknownNumbers) {
|
||||||
|
setDefaultCallerIdApp()
|
||||||
|
}
|
||||||
|
|
||||||
setupTabs()
|
setupTabs()
|
||||||
SimpleContact.sorting = config.sorting
|
SimpleContact.sorting = config.sorting
|
||||||
}
|
}
|
||||||
@@ -123,9 +129,12 @@ class MainActivity : SimpleActivity() {
|
|||||||
|
|
||||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||||
super.onActivityResult(requestCode, resultCode, resultData)
|
super.onActivityResult(requestCode, resultCode, resultData)
|
||||||
// we dont really care about the result, the app can work without being the default Dialer too
|
// we don't really care about the result, the app can work without being the default Dialer too
|
||||||
if (requestCode == REQUEST_CODE_SET_DEFAULT_DIALER) {
|
if (requestCode == REQUEST_CODE_SET_DEFAULT_DIALER) {
|
||||||
checkContactPermissions()
|
checkContactPermissions()
|
||||||
|
} else if (requestCode == REQUEST_CODE_SET_DEFAULT_CALLER_ID && resultCode != Activity.RESULT_OK) {
|
||||||
|
toast(R.string.must_make_default_caller_id_app, length = Toast.LENGTH_LONG)
|
||||||
|
baseConfig.blockUnknownNumbers = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user