diff --git a/Source/Android/app/src/main/AndroidManifest.xml b/Source/Android/app/src/main/AndroidManifest.xml index dab8ce63a3..a3459198be 100644 --- a/Source/Android/app/src/main/AndroidManifest.xml +++ b/Source/Android/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools" + package="org.dolphinemu.dolphinemu"> + android:banner="@drawable/banner_tv" + android:debuggable="true" + tools:ignore="HardcodedDebugMode"> @@ -56,6 +60,7 @@ @@ -68,26 +73,33 @@ + - + + @@ -99,14 +111,22 @@ - - + + + + + = Build.VERSION_CODES.M ? + PendingIntent.FLAG_IMMUTABLE : 0; + PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, flags); + + manager.requestPermission(dev, pendingIntent); } } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Java_WiimoteAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Java_WiimoteAdapter.java index 1892e3f597..f3e5e5274c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Java_WiimoteAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/Java_WiimoteAdapter.java @@ -9,6 +9,7 @@ import android.hardware.usb.UsbDeviceConnection; import android.hardware.usb.UsbEndpoint; import android.hardware.usb.UsbInterface; import android.hardware.usb.UsbManager; +import android.os.Build; import androidx.annotation.Keep; @@ -50,11 +51,14 @@ public class Java_WiimoteAdapter if (!manager.hasPermission(dev)) { Log.warning("Requesting permission for Wii Remote adapter"); - Intent intent = new Intent(); - PendingIntent pend_intent; - intent.setClass(context, USBPermService.class); - pend_intent = PendingIntent.getService(context, 0, intent, 0); - manager.requestPermission(dev, pend_intent); + + Intent intent = new Intent(context, USBPermService.class); + + int flags = Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? + PendingIntent.FLAG_IMMUTABLE : 0; + PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, flags); + + manager.requestPermission(dev, pendingIntent); } } }