Android Question (SOLVED) Android Things USE_PERIPHERAL_IO permission

walterf25

Expert
Licensed User
Longtime User
Hi all, i have been playing around with Android things installed on a Raspberry Pi 3, i have managed to install the image connect to it via ADB just fine, i'm trying to run a small example app that lists the available UART ports and connect to the Selected port.

I'am getting this error about the USE_PERIPHERAL_IO permission not being declared in the manifest file, however the permission is included.

I have done some research and in some threads a few people suggest to reboot the device after the first install, i have done that but i' am still getting the same error, i have read in another thread that this permission needs to be requested and allow the user to grant permission to it once the application is started.

Any thoughts on this anyone.

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
uart devices: (ArrayList) [MINIUART, UART0]
main_activity_create (java line: 350)
java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.USE_PERIPHERAL_IO
at android.os.Parcel.readException(Parcel.java:2005)
at android.os.Parcel.readException(Parcel.java:1951)
at com.google.android.things.pio.IPeripheralManagerClient$Stub$Proxy.GetUartClient(IPeripheralManagerClient.java:1455)
at com.google.android.things.pio.UartDeviceImpl.<init>(UartDeviceImpl.java:48)
at com.google.android.things.pio.PeripheralManager.openUartDevice(PeripheralManager.java:262)
at anywheresoftware.b4a.objects.PeripheralManagerWrapper.OpenUart(PeripheralManagerWrapper.java:51)
at com.genesis.raspii2c.main._activity_create(main.java:350)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at com.genesis.raspii2c.main.afterFirstLayout(main.java:104)
at com.genesis.raspii2c.main.access$000(main.java:17)
at com.genesis.raspii2c.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Thanks,
Walter
 
Top