mirror of
https://github.com/yuliskov/SmartTube.git
synced 2025-12-30 18:40:27 -06:00
remote control service fix on Android 12+
This commit is contained in:
@@ -45,8 +45,13 @@
|
||||
<action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<service android:name="com.liskovsoft.smartyoutubetv2.common.misc.RemoteControlService" android:enabled="true"/>
|
||||
<service android:name="com.liskovsoft.smartyoutubetv2.common.misc.BackgroundPlaybackService" android:enabled="true"/>
|
||||
<service
|
||||
android:name="com.liskovsoft.smartyoutubetv2.common.misc.RemoteControlService"
|
||||
android:enabled="true"
|
||||
android:foregroundServiceType="connectedDevice"/>
|
||||
<service
|
||||
android:name="com.liskovsoft.smartyoutubetv2.common.misc.BackgroundPlaybackService"
|
||||
android:enabled="true"/>
|
||||
|
||||
<activity android:name=".misc.BackupReceiverActivity"
|
||||
android:exported="true">
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.liskovsoft.smartyoutubetv2.common.misc;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build.VERSION;
|
||||
|
||||
import com.liskovsoft.sharedutils.mylogger.Log;
|
||||
import com.liskovsoft.smartyoutubetv2.common.utils.Utils;
|
||||
|
||||
@@ -11,10 +13,13 @@ public class RemoteControlReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Log.d(TAG, "Initializing remote control listener...");
|
||||
// Starting from Android 12 foreground service not supported
|
||||
if (VERSION.SDK_INT < 31) {
|
||||
Log.d(TAG, "Initializing remote control listener...");
|
||||
|
||||
// Fix unload from the memory on some devices?
|
||||
Utils.updateRemoteControlService(context);
|
||||
// Fix unload from the memory on some devices?
|
||||
Utils.updateRemoteControlService(context);
|
||||
}
|
||||
|
||||
//Utils.startRemoteControlWorkRequest(context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user