Skip to content
Snippets Groups Projects
Commit 90926cb5 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

fix calls for Android 14

Change-Id: Ie49fbb9cb253fd330f3edc356e737badf2f3307d
parent 0f615ead
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_REMOTE_MESSAGING" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
<uses-permission android:name="com.android.providers.tv.permission.WRITE_EPG_DATA" />
<uses-feature
......
......@@ -39,7 +39,9 @@ class CallNotificationService : Service() {
if (ACTION_START == intent.action) {
val notification = mNotificationService.showCallNotification(intent.getIntExtra(NotificationService.KEY_NOTIFICATION_ID, -1)) as Notification?
if (notification != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
startForeground(NotificationServiceImpl.NOTIF_CALL_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL)
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
startForeground(NotificationServiceImpl.NOTIF_CALL_ID, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_PHONE_CALL or ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION)
else
startForeground(NotificationServiceImpl.NOTIF_CALL_ID, notification)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment