[英]How to whitelist installer package during kiosk mode/ lock task mode?
I have created an kiosk application it has update functionality for other application within the device but the installer package is blocked.我创建了一个自助服务终端应用程序,它具有设备内其他应用程序的更新功能,但安装程序包被阻止。 How to whitelist installer package?如何将安装程序包列入白名单?
I have tried whitelisting this installer package but it is not working.我曾尝试将此安装程序包列入白名单,但它不起作用。 Maybe I'm missing an additional application to whitelist.也许我错过了一个额外的白名单应用程序。
...//My other whitelisted apps
private static String INSTALLER_PACKAGE = "com.google.android.packageInstaller";
private static String[] APP_PACKAGES = { ..., INSTALLER_PACKAGE};
...
dpm.setLockTaskPackages(cn, active ? APP_PACKAGES : new String[]{});
If you are setting FLAG_ACTIVITY_NEW_TASK
flag on the ACTION_INSTALL_PACKAGE
intent it will generally tell you "Unpinning is not allowed" when trying to invoke the PackageInstaller to update.如果您在ACTION_INSTALL_PACKAGE
意图上设置FLAG_ACTIVITY_NEW_TASK
标志,它通常会在尝试调用PackageInstaller进行更新时告诉您“不允许取消固定”。
For instance, in this example (AppCenter)例如,在这个例子中(AppCenter)
Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE);
intent.setData(fileUri);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // <-- giving me grief
intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
I have found through my investigations that HockeyApp, Microsoft AppCenter and TestFairy is setting this flag, so I was unable to use their out-of-the-box in-app update solution when pinned (task locked).我通过调查发现 HockeyApp、Microsoft AppCenter 和 TestFairy 正在设置此标志,因此我无法在固定(任务锁定)时使用它们的开箱即用应用内更新解决方案。 I'm also running android:launchMode="singleTask"
for what it's worth.我也在运行android:launchMode="singleTask"
以获得它的价值。
I was however able to change HockeyApp's library to my liking.但是,我能够根据自己的喜好更改 HockeyApp 的库。 This was my initial inquiry https://github.com/bitstadium/HockeySDK-Android/issues/368这是我最初的询问https://github.com/bitstadium/HockeySDK-Android/issues/368
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.