2

I've created my own android.jar so I can use the hidden API call 'DisplayManager.connectWifiDisplay()'.

When I run the app and call the method, after connecting to a display via Wifi Direct,

I get the following exception:

java.lang.SecurityException: Permission required to connect to a wifi display: Neither user 10105 nor current process has android.permission.CONFIGURE_WIFI_DISPLAY. at android.os.Parcel.readException(Parcel.java:1546) at android.os.Parcel.readException(Parcel.java:1499) at android.hardware.display.IDisplayManager$Stub$Proxy.connectWifiDisplay(IDisplayManager.java:344) at android.hardware.display.DisplayManagerGlobal.connectWifiDisplay(DisplayManagerGlobal.java:309) at android.hardware.display.DisplayManager.connectWifiDisplay(DisplayManager.java:404)

However, I have included the CONFIGURE_WIFI_DISPLAY and CONTROL_WIFI_DISPLAY permissions in my AndroidManifest. Any hints on what I could be missing here?

EDIT: I'm using Android L.

CalumMcCall
  • 1,665
  • 4
  • 24
  • 46

2 Answers2

2

Both of those permissions have a signature protection level (at least on Android 6.0 -- you will need to research if that protection level has changed over the years).

Hence, unless your app is signed by the platform signing key, you cannot hold those permissions, despite having them in your manifest.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I'm using 5.1. Assuming they do have signature protection level, what are my options? Is it possible to sign the app with the signing key myself? Can I bypass this at all? – CalumMcCall Dec 03 '15 at 18:34
  • @CalumMcCall: "what are my options?" -- build your own custom ROM, then sign the apps with the same signing key that you used to sign the ROM. Or, strike a deal with a device manufacturer to bundle your apps with their device, signed by their signing key. – CommonsWare Dec 03 '15 at 18:36
-3

I don't know if this is what you want, but you can try using this permission:

<uses-permission android:name="android.permission.INTERNET" />
L . Android
  • 33
  • 10