Commit da3764c3 by zhangchengbo

fix:替换通讯录App包名

parent f381a2da
......@@ -28,8 +28,7 @@
tools:node="remove" />
<queries>
<package android:name="com.simplemobiletools.contacts.pro.debug" />
<package android:name="com.simplemobiletools.contacts.pro" />
<package android:name="com.secspace.contacts" />
</queries>
<uses-feature android:name="android.hardware.telephony" />
......
......@@ -52,16 +52,16 @@ fun Activity.launchViewIntent(uri: Uri, mimetype: String, filename: String) {
}
fun Activity.startContactDetailsIntent(contact: SimpleContact) {
val simpleContacts = "com.simplemobiletools.contacts.pro"
val simpleContactsDebug = "com.simplemobiletools.contacts.pro.debug"
val simpleContacts = "com.secspace.contacts"
if (contact.rawId > 1000000 && contact.contactId > 1000000 && contact.rawId == contact.contactId &&
(isPackageInstalled(simpleContacts) || isPackageInstalled(simpleContactsDebug))
(isPackageInstalled(simpleContacts))
) {
Intent().apply {
action = Intent.ACTION_VIEW
putExtra(CONTACT_ID, contact.rawId)
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")
launchActivityIntent(this)
}
......
......@@ -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
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
} 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)
roleManager!!.isRoleAvailable(RoleManager.ROLE_DIALER) && roleManager.isRoleHeld(RoleManager.ROLE_DIALER)
} 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