Skip the contact links migration if contact permissions are disabled.
This commit is contained in:
parent
7771aaa501
commit
4f3ee9ca1d
1 changed files with 8 additions and 0 deletions
|
@ -5,6 +5,9 @@
|
|||
|
||||
package org.thoughtcrime.securesms.migrations
|
||||
|
||||
import android.Manifest
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.core.content.ContextCompat
|
||||
import org.signal.contacts.SystemContactsRepository
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
|
@ -38,6 +41,11 @@ internal class ContactLinkRebuildMigrationJob(parameters: Parameters = Parameter
|
|||
return
|
||||
}
|
||||
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
|
||||
Log.w(TAG, "We don't have the right permissions to perform this migration!")
|
||||
return
|
||||
}
|
||||
|
||||
SystemContactsRepository.addMessageAndCallLinksToContacts(
|
||||
context = context,
|
||||
config = SyncSystemContactLinksJob.buildContactLinkConfiguration(context, account),
|
||||
|
|
Loading…
Add table
Reference in a new issue