mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 14:27:24 +00:00
Merge pull request #2073 from nextcloud/chore/noid/compileSdk31
Bump compile sdk to 31
This commit is contained in:
commit
4b7a0721c1
@ -35,7 +35,7 @@ apply plugin: 'io.gitlab.arturbosch.detekt'
|
||||
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion 31
|
||||
buildToolsVersion '32.0.0'
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
|
@ -38,6 +38,7 @@
|
||||
android:name="android.permission.AUTHENTICATE_ACCOUNTS"
|
||||
android:maxSdkVersion="22" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission
|
||||
android:name="android.permission.GET_ACCOUNTS"
|
||||
@ -75,8 +76,8 @@
|
||||
<!-- This permission is deprecated in Android P -->
|
||||
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
|
||||
<application
|
||||
android:name=".application.NextcloudTalkApplication"
|
||||
|
@ -209,7 +209,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
||||
if (cursor != null) {
|
||||
if (cursor.moveToFirst()) {
|
||||
// userId @ server
|
||||
userId = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DATA1))
|
||||
userId = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Data.DATA1))
|
||||
}
|
||||
|
||||
cursor.close()
|
||||
|
@ -1382,7 +1382,7 @@ class ChatController(args: Bundle) :
|
||||
val cursor: Cursor? = activity?.contentResolver!!.query(contactUri, null, null, null, null)
|
||||
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
val id = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID))
|
||||
val id = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts._ID))
|
||||
val fileName = ContactUtils.getDisplayNameFromDeviceContact(context!!, id) + ".vcf"
|
||||
val file = File(context?.cacheDir, fileName)
|
||||
writeContactToVcfFile(cursor, file)
|
||||
@ -1427,7 +1427,7 @@ class ChatController(args: Bundle) :
|
||||
}
|
||||
|
||||
private fun writeContactToVcfFile(cursor: Cursor, file: File) {
|
||||
val lookupKey = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY))
|
||||
val lookupKey = cursor.getString(cursor.getColumnIndexOrThrow(ContactsContract.Contacts.LOOKUP_KEY))
|
||||
val uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_VCARD_URI, lookupKey)
|
||||
|
||||
val fd: AssetFileDescriptor = activity?.contentResolver!!.openAssetFileDescriptor(uri, "r")!!
|
||||
|
@ -175,9 +175,11 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
if (contactCursor.count > 0) {
|
||||
contactCursor.moveToFirst()
|
||||
for (i in 0 until contactCursor.count) {
|
||||
val id = contactCursor.getString(contactCursor.getColumnIndex(ContactsContract.Contacts._ID))
|
||||
val id = contactCursor.getString(contactCursor.getColumnIndexOrThrow(ContactsContract.Contacts._ID))
|
||||
val lookup =
|
||||
contactCursor.getString(contactCursor.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY))
|
||||
contactCursor.getString(
|
||||
contactCursor.getColumnIndexOrThrow(ContactsContract.Contacts.LOOKUP_KEY)
|
||||
)
|
||||
deviceContactsWithNumbers[lookup] = getPhoneNumbersFromDeviceContact(id)
|
||||
contactCursor.moveToNext()
|
||||
}
|
||||
@ -228,13 +230,16 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
if (rawContactsCursor.count > 0) {
|
||||
while (rawContactsCursor.moveToNext()) {
|
||||
val lookupKey =
|
||||
rawContactsCursor.getString(rawContactsCursor.getColumnIndex(ContactsContract.Data.LOOKUP_KEY))
|
||||
val contactId =
|
||||
rawContactsCursor.getString(rawContactsCursor.getColumnIndex(ContactsContract.Data.CONTACT_ID))
|
||||
|
||||
if (contactsWithAssociatedPhoneNumbers == null || !contactsWithAssociatedPhoneNumbers.containsKey(
|
||||
lookupKey
|
||||
rawContactsCursor.getString(
|
||||
rawContactsCursor.getColumnIndexOrThrow(ContactsContract.Data.LOOKUP_KEY)
|
||||
)
|
||||
val contactId =
|
||||
rawContactsCursor.getString(
|
||||
rawContactsCursor.getColumnIndexOrThrow(ContactsContract.Data.CONTACT_ID)
|
||||
)
|
||||
|
||||
if (contactsWithAssociatedPhoneNumbers == null ||
|
||||
!contactsWithAssociatedPhoneNumbers.containsKey(lookupKey)
|
||||
) {
|
||||
deleteLinkedAccount(contactId)
|
||||
}
|
||||
@ -302,7 +307,7 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
if (contactCursor.count > 0) {
|
||||
contactCursor.moveToFirst()
|
||||
|
||||
val id = contactCursor.getString(contactCursor.getColumnIndex(ContactsContract.Contacts._ID))
|
||||
val id = contactCursor.getString(contactCursor.getColumnIndexOrThrow(ContactsContract.Contacts._ID))
|
||||
if (hasLinkedAccount(id)) {
|
||||
return
|
||||
}
|
||||
@ -416,7 +421,7 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
while (phonesNumbersCursor.moveToNext()) {
|
||||
numbers.add(
|
||||
phonesNumbersCursor.getString(
|
||||
phonesNumbersCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)
|
||||
phonesNumbersCursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.NUMBER)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ object ContactUtils {
|
||||
while (nameCursor.moveToNext()) {
|
||||
displayName =
|
||||
nameCursor.getString(
|
||||
nameCursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME)
|
||||
nameCursor.getColumnIndexOrThrow(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME)
|
||||
)
|
||||
}
|
||||
nameCursor.close()
|
||||
|
@ -36,7 +36,7 @@ class UriUtils {
|
||||
val cursor: Cursor? = context.contentResolver.query(uri, null, null, null, null)
|
||||
try {
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
filename = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME))
|
||||
filename = cursor.getString(cursor.getColumnIndexOrThrow(OpenableColumns.DISPLAY_NAME))
|
||||
}
|
||||
} finally {
|
||||
cursor?.close()
|
||||
|
@ -42,6 +42,7 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.media.AudioManager;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Process;
|
||||
@ -317,10 +318,9 @@ public class MagicBluetoothManager {
|
||||
@SuppressLint("HardwareIds")
|
||||
protected void logBluetoothAdapterInfo(BluetoothAdapter localAdapter) {
|
||||
Log.d(TAG, "BluetoothAdapter: "
|
||||
+ "enabled=" + localAdapter.isEnabled() + ", "
|
||||
+ "state=" + stateToString(localAdapter.getState()) + ", "
|
||||
+ "name=" + localAdapter.getName() + ", "
|
||||
+ "address=" + localAdapter.getAddress());
|
||||
+ "enabled=" + localAdapter.isEnabled() + ", "
|
||||
+ "state=" + stateToString(localAdapter.getState()) + ", "
|
||||
+ "name=" + localAdapter.getName());
|
||||
// Log the set of BluetoothDevice objects that are bonded (paired) to the local adapter.
|
||||
Set<BluetoothDevice> pairedDevices = localAdapter.getBondedDevices();
|
||||
if (!pairedDevices.isEmpty()) {
|
||||
|
Loading…
Reference in New Issue
Block a user