mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Merge pull request #3533 from nextcloud/chore/noid/Android14
🤖Android 1️⃣4️⃣
This commit is contained in:
commit
f75d98c573
@ -43,7 +43,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 33
|
targetSdkVersion 34
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
// mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable)
|
// mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable)
|
||||||
|
@ -14,6 +14,12 @@
|
|||||||
<ignore path="**/values-**/strings.xml" />
|
<ignore path="**/values-**/strings.xml" />
|
||||||
</issue>
|
</issue>
|
||||||
|
|
||||||
|
<issue id="MissingQuantity">
|
||||||
|
<ignore path="**/values-ka-rGE/strings.xml"/>
|
||||||
|
<ignore path="**/values-ar/strings.xml" />
|
||||||
|
<ignore path="**/values-ca/strings.xml" />
|
||||||
|
</issue>
|
||||||
|
|
||||||
<issue id="TypographyEllipsis">
|
<issue id="TypographyEllipsis">
|
||||||
<ignore path="**/values-**/strings.xml" />
|
<ignore path="**/values-**/strings.xml" />
|
||||||
</issue>
|
</issue>
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".application.NextcloudTalkApplication"
|
android:name=".application.NextcloudTalkApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@ -40,8 +42,7 @@
|
|||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".services.firebase.NCFirebaseMessagingService"
|
android:name=".services.firebase.NCFirebaseMessagingService"
|
||||||
android:exported="false"
|
android:exported="false">
|
||||||
android:foregroundServiceType="phoneCall">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
@ -113,6 +113,7 @@ import com.nextcloud.talk.utils.ApiUtils
|
|||||||
import com.nextcloud.talk.utils.DisplayUtils
|
import com.nextcloud.talk.utils.DisplayUtils
|
||||||
import com.nextcloud.talk.utils.NotificationUtils.cancelExistingNotificationsForRoom
|
import com.nextcloud.talk.utils.NotificationUtils.cancelExistingNotificationsForRoom
|
||||||
import com.nextcloud.talk.utils.NotificationUtils.getCallRingtoneUri
|
import com.nextcloud.talk.utils.NotificationUtils.getCallRingtoneUri
|
||||||
|
import com.nextcloud.talk.utils.ReceiverFlag
|
||||||
import com.nextcloud.talk.utils.VibrationUtils.vibrateShort
|
import com.nextcloud.talk.utils.VibrationUtils.vibrateShort
|
||||||
import com.nextcloud.talk.utils.animations.PulseAnimation
|
import com.nextcloud.talk.utils.animations.PulseAnimation
|
||||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_VOICE_ONLY
|
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_VOICE_ONLY
|
||||||
@ -136,6 +137,7 @@ import com.nextcloud.talk.utils.database.user.CapabilitiesUtilNew.isCallRecordin
|
|||||||
import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
|
import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
|
||||||
import com.nextcloud.talk.utils.permissions.PlatformPermissionUtil
|
import com.nextcloud.talk.utils.permissions.PlatformPermissionUtil
|
||||||
import com.nextcloud.talk.utils.power.PowerManagerUtils
|
import com.nextcloud.talk.utils.power.PowerManagerUtils
|
||||||
|
import com.nextcloud.talk.utils.registerPermissionHandlerBroadcastReceiver
|
||||||
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder
|
import com.nextcloud.talk.utils.singletons.ApplicationWideCurrentRoomHolder
|
||||||
import com.nextcloud.talk.viewmodels.CallRecordingViewModel
|
import com.nextcloud.talk.viewmodels.CallRecordingViewModel
|
||||||
import com.nextcloud.talk.viewmodels.CallRecordingViewModel.RecordingConfirmStopState
|
import com.nextcloud.talk.viewmodels.CallRecordingViewModel.RecordingConfirmStopState
|
||||||
@ -3015,11 +3017,12 @@ class CallActivity : CallBaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
registerReceiver(
|
registerPermissionHandlerBroadcastReceiver(
|
||||||
mReceiver,
|
mReceiver,
|
||||||
IntentFilter(MICROPHONE_PIP_INTENT_NAME),
|
IntentFilter(MICROPHONE_PIP_INTENT_NAME),
|
||||||
permissionUtil!!.privateBroadcastPermission,
|
permissionUtil!!.privateBroadcastPermission,
|
||||||
null
|
null,
|
||||||
|
ReceiverFlag.NotExported
|
||||||
)
|
)
|
||||||
updateUiForPipMode()
|
updateUiForPipMode()
|
||||||
} else {
|
} else {
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Android client application
|
||||||
|
*
|
||||||
|
* @author Alper Ozturk
|
||||||
|
* Copyright (C) 2023 Alper Ozturk
|
||||||
|
* Copyright (C) 2023 Nextcloud GmbH
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.nextcloud.talk.utils
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.Handler
|
||||||
|
|
||||||
|
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
||||||
|
fun Context.registerBroadcastReceiver(receiver: BroadcastReceiver?, filter: IntentFilter, flag: ReceiverFlag): Intent? {
|
||||||
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
registerReceiver(receiver, filter, flag.getId())
|
||||||
|
} else {
|
||||||
|
registerReceiver(receiver, filter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
||||||
|
fun Context.registerPermissionHandlerBroadcastReceiver(
|
||||||
|
receiver: BroadcastReceiver?,
|
||||||
|
filter: IntentFilter,
|
||||||
|
broadcastPermission: String?,
|
||||||
|
scheduler: Handler?,
|
||||||
|
flag: ReceiverFlag
|
||||||
|
): Intent? {
|
||||||
|
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||||
|
registerReceiver(receiver, filter, broadcastPermission, scheduler, flag.getId())
|
||||||
|
} else {
|
||||||
|
registerReceiver(receiver, filter, broadcastPermission, scheduler)
|
||||||
|
}
|
||||||
|
}
|
35
app/src/main/java/com/nextcloud/talk/utils/ReceiverFlag.kt
Normal file
35
app/src/main/java/com/nextcloud/talk/utils/ReceiverFlag.kt
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Nextcloud Android client application
|
||||||
|
*
|
||||||
|
* @author Alper Ozturk
|
||||||
|
* Copyright (C) 2023 Alper Ozturk
|
||||||
|
* Copyright (C) 2023 Nextcloud GmbH
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.nextcloud.talk.utils
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.os.Build
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
|
||||||
|
enum class ReceiverFlag {
|
||||||
|
NotExported;
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
|
||||||
|
fun getId(): Int {
|
||||||
|
return Context.RECEIVER_NOT_EXPORTED
|
||||||
|
}
|
||||||
|
}
|
@ -44,6 +44,8 @@ import android.media.AudioManager;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.nextcloud.talk.events.ProximitySensorEvent;
|
import com.nextcloud.talk.events.ProximitySensorEvent;
|
||||||
|
import com.nextcloud.talk.utils.ContextExtensionsKt;
|
||||||
|
import com.nextcloud.talk.utils.ReceiverFlag;
|
||||||
import com.nextcloud.talk.utils.power.PowerManagerUtils;
|
import com.nextcloud.talk.utils.power.PowerManagerUtils;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -55,7 +57,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
public class WebRtcAudioManager {
|
public class WebRtcAudioManager {
|
||||||
private static final String TAG = WebRtcAudioManager.class.getSimpleName();
|
private static final String TAG = WebRtcAudioManager.class.getSimpleName();
|
||||||
private final Context magicContext;
|
private final Context context;
|
||||||
private final WebRtcBluetoothManager bluetoothManager;
|
private final WebRtcBluetoothManager bluetoothManager;
|
||||||
private final boolean useProximitySensor;
|
private final boolean useProximitySensor;
|
||||||
private final AudioManager audioManager;
|
private final AudioManager audioManager;
|
||||||
@ -81,7 +83,7 @@ public class WebRtcAudioManager {
|
|||||||
private WebRtcAudioManager(Context context, boolean useProximitySensor) {
|
private WebRtcAudioManager(Context context, boolean useProximitySensor) {
|
||||||
Log.d(TAG, "ctor");
|
Log.d(TAG, "ctor");
|
||||||
ThreadUtils.checkIsOnMainThread();
|
ThreadUtils.checkIsOnMainThread();
|
||||||
magicContext = context;
|
this.context = context;
|
||||||
audioManager = ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE));
|
audioManager = ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE));
|
||||||
bluetoothManager = WebRtcBluetoothManager.create(context, this);
|
bluetoothManager = WebRtcBluetoothManager.create(context, this);
|
||||||
wiredHeadsetReceiver = new WiredHeadsetReceiver();
|
wiredHeadsetReceiver = new WiredHeadsetReceiver();
|
||||||
@ -339,14 +341,14 @@ public class WebRtcAudioManager {
|
|||||||
* Helper method for receiver registration.
|
* Helper method for receiver registration.
|
||||||
*/
|
*/
|
||||||
private void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
|
private void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
|
||||||
magicContext.registerReceiver(receiver, filter);
|
ContextExtensionsKt.registerBroadcastReceiver(context, receiver, filter, ReceiverFlag.NotExported);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method for unregistration of an existing receiver.
|
* Helper method for unregistration of an existing receiver.
|
||||||
*/
|
*/
|
||||||
private void unregisterReceiver(BroadcastReceiver receiver) {
|
private void unregisterReceiver(BroadcastReceiver receiver) {
|
||||||
magicContext.unregisterReceiver(receiver);
|
context.unregisterReceiver(receiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -375,7 +377,7 @@ public class WebRtcAudioManager {
|
|||||||
* Gets the current earpiece state.
|
* Gets the current earpiece state.
|
||||||
*/
|
*/
|
||||||
private boolean hasEarpiece() {
|
private boolean hasEarpiece() {
|
||||||
return magicContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
|
return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,6 +51,9 @@ import android.os.Looper;
|
|||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.nextcloud.talk.utils.ContextExtensionsKt;
|
||||||
|
import com.nextcloud.talk.utils.ReceiverFlag;
|
||||||
|
|
||||||
import org.webrtc.ThreadUtils;
|
import org.webrtc.ThreadUtils;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -300,7 +303,11 @@ public class WebRtcBluetoothManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
|
protected void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
|
||||||
apprtcContext.registerReceiver(receiver, filter);
|
ContextExtensionsKt.registerBroadcastReceiver(
|
||||||
|
apprtcContext,
|
||||||
|
receiver,
|
||||||
|
filter,
|
||||||
|
ReceiverFlag.NotExported);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void unregisterReceiver(BroadcastReceiver receiver) {
|
protected void unregisterReceiver(BroadcastReceiver receiver) {
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
DO NOT TOUCH; GENERATED BY DRONE
|
DO NOT TOUCH; GENERATED BY DRONE
|
||||||
<span class="mdl-layout-title">Lint Report: 8 errors and 83 warnings</span>
|
<span class="mdl-layout-title">Lint Report: 8 errors and 80 warnings</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user