— a/vendor/mediatek/proprietary/packages/apps/Music/src/com/android/music/MediaButtonIntentReceiver.java
+++ b/vendor/mediatek/proprietary/packages/apps/Music/src/com/android/music/MediaButtonIntentReceiver.java
@@ -35,6 +35,9 @@ import android.os.Message;
import android.os.UserHandle;
import android.view.KeyEvent;
+import android.os.Build;
+
+
/**
*
*/
@@ -246,7 +249,13 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver {
i.putExtra(MediaPlaybackService.DELTATIME, deltaTime);
MusicLogUtils.d(TAG, "sendToStartService,UserHandle.CURRENT: " + UserHandle.CURRENT);
//for multi user,when use BT play music,should start service match current user
-
context.startServiceAsUser(i, UserHandle.CURRENT);
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
-
context.startForegroundService(i);
-
} else {
-
context.startServiceAsUser(i, UserHandle.CURRENT);
-
}
-
//context.startServiceAsUser(i, UserHandle.CURRENT);
}
/**