android - com.sonyericsson.permission.BLACKLISTED_USB_DEVICE -
i'm developing app connect android usb device host. when connecting sony phone , trying receive android.hardware.usb.action.usb_device_attached intent filter or directly in broadcast receiver receive next message on sony z3 compact device (android 5.0.2):
permission denial: receiving intent { act=android.hardware.usb.action.usb_device_attached flg=0x10 (has extras) } processrecord{***anid** **anid:my.app.package/u0anid} (pid=xxxxx, uid=xxxxx) requires com.sonyericsson.permission.blacklisted_usb_device due sender android (uid 1000)
do need call specific permission? send validation number request? usb device need send special?
can tell me whats matter? thank trying help.
1st update thank's ddpwnage reply... i'm turning arround permission denial... trying set
<permission android:name="com.sonyericsson.permission.blacklisted_usb_device" android:protectionlevel="signature" /> but change nothing. i've set device_filter
<resources> <usb-device vendor-id="xxxxx" product-id="xxxx"/> </resources> with in manifest
<permission android:name="my.package.usb_permission" /> <uses-permission android:name="my.package.usb_permission" /> <uses-feature android:name="android.hardware.usb.host" android:required="false" /> i've trying set
<permission android:name="my.package.usb_permission" android:protectionlevel="signature" /> but cannot figured out why device should in blacklist of usb
2nd update
i realized have message before permission denial :
calling method in system process without qualified user: android.app.contextimpl.sendbroadcast:1340 com.android.server.usb.usbsettingsmanager.blacklisteddeviceattached:757 com.android.server.usb.usbhostmanager.endusbdeviceadded:303 com.android.server.usb.usbhostmanager.monitorusbhostbus:-2 com.android.server.usb.usbhostmanager.access$000:54
when in usbhostmanager didn't see reason why on standard android devices works on sony devices i've waring message. in class have these 2 methods check blacklisted devices :
private boolean isblacklisted(string devicename) { int count = mhostblacklist.length; (int = 0; < count; i++) { if (devicename.startswith(mhostblacklist[i])) { return true; } } return false; } /* returns true if usb device should not accessible applications */ private boolean isblacklisted(int clazz, int subclass, int protocol) { // blacklist hubs if (clazz == usbconstants.usb_class_hub) return true; // blacklist hid boot devices (mouse , keyboard) if (clazz == usbconstants.usb_class_hid && subclass == usbconstants.usb_interface_subclass_boot) { return true; } return false; }
my device not usb_class_hub nor usb_class_hid, things see device in mhostblacklist. each constructor have own host blacklist or given android?
mhostblacklist = context.getresources().getstringarray( com.android.internal.r.array.config_usbhostblacklist);
seems android customizable contructors? , in case why did sony blacklist our usb device?
somebody sony here help?
thank time.
let me try , dissect log:
permission denial: receiving intent {
something's receiving intent! it?
act=android.hardware.usb.action.usb_device_attached flg=0x10 (has extras) }
the action here android.hardware.usb.action.usb_device_attached flg (flag?) 0x10 (hex 2), guessing means (has extras). guessing that's intent reciever's trying receive.
to processrecord{***anid** **anid:my.app.package/u0anid} (pid=xxxxx, uid=xxxxx)
your app receiver of object... got it.
requires com.sonyericsson.permission.blacklisted_usb_device due sender android (uid 1000)
it seems here's error is. in order usb_device_attached event sent app, app needs permission first. importantly, needs blacklisted_usb_device permission.
it may device "blacklisted", but, why? see if blacklisted_usb_device permission can enabled, , try again.
as further hint: crash log begins permission denial.
Comments
Post a Comment