Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not updated to support 0.5.1-preview #7

Open
clhols opened this issue Oct 31, 2017 · 1 comment
Open

Not updated to support 0.5.1-preview #7

clhols opened this issue Oct 31, 2017 · 1 comment

Comments

@clhols
Copy link

clhols commented Oct 31, 2017

When trying to run on 0.5.1-preview I get the following exception:

com.example.androidthings.bluetooth.audio E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                         Process: com.example.androidthings.bluetooth.audio, PID: 1948
                                                                                         java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androidthings.bluetooth.audio/com.example.androidthings.bluetooth.audio.A2dpSinkActivity}: java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.MANAGE_INPUT_DRIVERS
                                                                                             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
                                                                                             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
                                                                                             at android.app.ActivityThread.-wrap11(Unknown Source:0)
                                                                                             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
                                                                                             at android.os.Handler.dispatchMessage(Handler.java:105)
                                                                                             at android.os.Looper.loop(Looper.java:164)
                                                                                             at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                                                             at java.lang.reflect.Method.invoke(Native Method)
                                                                                             at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                                                                                          Caused by: java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.MANAGE_INPUT_DRIVERS
                                                                                             at android.os.Parcel.readException(Parcel.java:1942)
                                                                                             at android.os.Parcel.readException(Parcel.java:1888)
                                                                                             at com.google.android.things.userdriver.IInputDriverService$Stub$Proxy.createInputDevice(IInputDriverService.java:140)
                                                                                             at com.google.android.things.userdriver.InputDriver.initialize(InputDriver.java:241)
                                                                                             at com.google.android.things.userdriver.InputDriverManager.addInputDriver(InputDriverManager.java:47)
                                                                                             at com.google.android.things.userdriver.UserDriverManager.registerInputDriver(UserDriverManager.java:83)
                                                                                             at com.google.android.things.contrib.driver.button.ButtonInputDriver.register(ButtonInputDriver.java:83)
                                                                                             at com.example.androidthings.bluetooth.audio.A2dpSinkActivity.configureButton(A2dpSinkActivity.java:311)
                                                                                             at com.example.androidthings.bluetooth.audio.A2dpSinkActivity.initA2DPSink(A2dpSinkActivity.java:247)
                                                                                             at com.example.androidthings.bluetooth.audio.A2dpSinkActivity.onCreate(A2dpSinkActivity.java:173)

So it needs me to request the MANAGE_INPUT_DRIVERS permission. And if I do that:
ActivityCompat.requestPermissions(this, new String[]{"com.google.android.things.permission.MANAGE_INPUT_DRIVERS"}, 0);

Then the UI displays an "Allow ... to perform" dialog. But if my IoT device doesn't have screen and input then you can't click the allow button.

@pdominique
Copy link

@clhols the app starts for me on a Pi 3 with dev preview 0.5.1 and I can hear an audio sample. However I can't connect to the device: #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants