![](/img/trans.png)
[英]Android NFC device owner provisioning: send custom properties. Is it possible?
[英]How to customize Android Google Setup Wizard for device owner provisioning?
- 使用案例:
在priv-app文件夹中的1-System app apk将用作设备所有者。
2 - 用户启动设备并启动Google安装向导。
3 - 立即启动设备配置活动。
- 以前工作的事情:
此方法过去使用动作意图在Android 6.0 Marshmallow上工作:
<activity android:theme="@style/InvisibleNoTitle" android:name="OwnerActivity" android:launchMode="singleTop" android:immersive="true">
<intent-filter android:priority="5">
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.DEVICE_INITIALIZATION_WIZARD" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
没有任何问题。
更新到Android 8.1 Oreo后,此方法不再有效。 OwnerActivity仅在设置向导完成后显示,这是无用的,因为设备已由用户配置且无法再次提供。
有没有更新的方法这样做,以便我的OwnerActivity首先显示配置设备? 奥利奥有什么变化?
对于答案来说,这有点晚了,如果不与谷歌交谈,有点难以看出设计决策是什么。 但是,我们所知道的是改变了什么。 1.至少早在Oreo上就推荐使用android.intent.action.DEVICE_INITIALIZATION_WIZARD
。 2.程序包管理器服务已进行更改以引用设置向导。 新方法似乎是您的清单定义缺少的android.intent.category.SETUP_WIZARD
类别。
阅读代码周围的注释(您可以在下面找到),我们看到这个日志:
Slog.e(TAG, "There should probably be exactly one setup wizard; found " + matches.size()
+ ": matches=" + matches);
因此,就像Nougat一样,Android不支持将多个设置向导链接在一起。 对于您如何设置设备管理员的具体问题,我有2条建议。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.