Commit da3764c3 by zhangchengbo

fix:替换通讯录App包名

parent f381a2da
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
tools:node="remove" /> tools:node="remove" />
<queries> <queries>
<package android:name="com.simplemobiletools.contacts.pro.debug" /> <package android:name="com.secspace.contacts" />
<package android:name="com.simplemobiletools.contacts.pro" />
</queries> </queries>
<uses-feature android:name="android.hardware.telephony" /> <uses-feature android:name="android.hardware.telephony" />
......
...@@ -52,16 +52,16 @@ fun Activity.launchViewIntent(uri: Uri, mimetype: String, filename: String) { ...@@ -52,16 +52,16 @@ fun Activity.launchViewIntent(uri: Uri, mimetype: String, filename: String) {
} }
fun Activity.startContactDetailsIntent(contact: SimpleContact) { fun Activity.startContactDetailsIntent(contact: SimpleContact) {
val simpleContacts = "com.simplemobiletools.contacts.pro" val simpleContacts = "com.secspace.contacts"
val simpleContactsDebug = "com.simplemobiletools.contacts.pro.debug"
if (contact.rawId > 1000000 && contact.contactId > 1000000 && contact.rawId == contact.contactId && if (contact.rawId > 1000000 && contact.contactId > 1000000 && contact.rawId == contact.contactId &&
(isPackageInstalled(simpleContacts) || isPackageInstalled(simpleContactsDebug)) (isPackageInstalled(simpleContacts))
) { ) {
Intent().apply { Intent().apply {
action = Intent.ACTION_VIEW action = Intent.ACTION_VIEW
putExtra(CONTACT_ID, contact.rawId) putExtra(CONTACT_ID, contact.rawId)
putExtra(IS_PRIVATE, true) putExtra(IS_PRIVATE, true)
setPackage(if (isPackageInstalled(simpleContacts)) simpleContacts else simpleContactsDebug) if (isPackageInstalled(simpleContacts))
setPackage(simpleContacts)
setDataAndType(ContactsContract.Contacts.CONTENT_LOOKUP_URI, "vnd.android.cursor.dir/person") setDataAndType(ContactsContract.Contacts.CONTENT_LOOKUP_URI, "vnd.android.cursor.dir/person")
launchActivityIntent(this) launchActivityIntent(this)
} }
......
...@@ -1005,9 +1005,9 @@ fun Context.getCornerRadius() = resources.getDimension(R.dimen.rounded_corner_ra ...@@ -1005,9 +1005,9 @@ fun Context.getCornerRadius() = resources.getDimension(R.dimen.rounded_corner_ra
// we need the Default Dialer functionality only in Simple Dialer and in Simple Contacts for now // we need the Default Dialer functionality only in Simple Dialer and in Simple Contacts for now
fun Context.isDefaultDialer(): Boolean { fun Context.isDefaultDialer(): Boolean {
return if (!packageName.startsWith("com.simplemobiletools.contacts") && !packageName.startsWith("com.simplemobiletools.dialer")) { return if (!packageName.startsWith("com.secspace.contacts") && !packageName.startsWith("com.secspace.dialer")) {
true true
} else if ((packageName.startsWith("com.simplemobiletools.contacts") || packageName.startsWith("com.simplemobiletools.dialer")) && isQPlus()) { } else if ((packageName.startsWith("com.secspace.contacts") || packageName.startsWith("com.secspace.dialer")) && isQPlus()) {
val roleManager = getSystemService(RoleManager::class.java) val roleManager = getSystemService(RoleManager::class.java)
roleManager!!.isRoleAvailable(RoleManager.ROLE_DIALER) && roleManager.isRoleHeld(RoleManager.ROLE_DIALER) roleManager!!.isRoleAvailable(RoleManager.ROLE_DIALER) && roleManager.isRoleHeld(RoleManager.ROLE_DIALER)
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment