简体   繁体   English

在Android 5.0中通过NFC激活设备所有者期间无法连接Wifi

[英]Unable to connect Wifi during Device Owner activation in Android 5.0 via NFC

Properties p = new Properties();                        
p.setProperty(DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME,"com.somepackage.app");
p.setProperty(DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION,"https"//example.com/app/app.apk");
p.setProperty(DevicePolicyManager.EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM,"akjlsdghadkq");
p.setProperty(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SSID, "aaaSSID");
p.setProperty(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_PASSWORD,"password");
p.setProperty(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SECURITY_TYPE, "WPA");
p.setProperty(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_HIDDEN, "false");
ByteArrayOutputStream bos = new ByteArrayOutputStream();
OutputStream out;
out = new ObjectOutputStream(bos);
p.store(out, "");
final byte[] bytes = bos.toByteArray();
record = (NdefRecord.createMime("application/com.android.managedprovisioning", bytes));

I have used the above code for NFC message. 我已将上述代码用于NFC消息。 Everything works fine except the Wifi part. 除了Wifi部分,一切正常。 The process stalls with "Connecting Wifi" screen when Wifi is included in the NFC message. 当NFC信息中包含Wifi时,该过程会以“连接Wifi”屏幕停止。

When the Wifi settings are not included in the NFC message, a list of available Wifi Networks is shown from which any network chosen. 当NFC消息中不包括Wifi设置时,将显示可用的Wifi网络列表,从中选择任何网络。 After that, it downloads the .apk file from the specified download url, computes checksum and verifies it with the specified checksum in the nfc message. 之后,它从指定的下载URL下载.apk文件,计算校验和并使用nfc消息中的指定校验和进行验证。 Finally device owner is activated. 最后设备所有者被激活。

The problem occurs only when the Wifi details are specified in the NFC message. 仅当在NFC消息中指定了Wifi详细信息时,才会出现此问题。 The device owner provisioning process stalls with "Connecting Wifi". 设备所有者配置过程停止“连接Wifi”。

The same occurs when the wrong Wifi password is provided. 提供错误的Wifi密码时也会出现同样的情况。 There is no indication that the password is wrong. 没有迹象表明密码错误。

Kindly help me with this! 请帮助我!

We have also had some issues with wifi and Device Owner provisioning in L MR0 (Android 5.0). 我们在L MR0(Android 5.0)中也遇到了一些与wifi和设备所有者配置有关的问题。

However this issue and many more small bugs have been fixed in L MR1, so please try to use L MR1 (Android 5.1) if you can. 然而,这个问题和更多小错误已在L MR1中修复,因此如果可以,请尝试使用L MR1(Android 5.1)。 It works for us now in L MR1. 它现在在L MR1中适用于我们。

The issues have mainly been in the ManagedProvisioning git: https://android.googlesource.com/platform/packages/apps/ManagedProvisioning/ 这些问题主要出现在ManagedProvisioning git中: https ://android.googlesource.com/platform/packages/apps/ManagedProvisioning/

(I work at Sony Mobile.) (我在索尼移动公司工作。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM