Kiosk app updates when device not online at consistent times

时光毁灭记忆、已成空白 提交于 2020-07-10 06:01:30

问题


Background

I currently maintain a Kiosk app on devices managed by the Android Management API. These devices run Android 7.

I had been managing the app updates on these devices via the application minimumVersionCode, and moving the devices onto a new policy every time with a higher minimumVersionCode, forcing the affected devices to update the app. However some of the devices would factory reset if they had been off for a reasonable period of time (a week or two) even after extending the wipeDays to 300 etc (I've reported a bug separately for this).

So, I need to work around the above bug, and I guess moving devices en-masse between policies isn't a well tested or the perceived "correct" way to do this. I see the recommended configuration for managing kiosks using the API has been stealthily changed in the last 6-9 months (according to archive.org .. nothing in the API changelog). There is now an applications.[x].installType of 'KIOSK'.

Question

I've got around 250 kiosks that have varied on/off times. Some will turn on at 8am and will be turned off at 3pm. Others will turn on at say 6pm and will turn off at midnight. Others will stay on all the time (although note that I do have the ability to remotely reboot them via the Android Management API).

So WRT updating the kiosk app, there isn't a neat tight maintenance window of 2-3am that I can configure.

Will specifying a maintenance window of "all day" get around this? E.g:

{

...

  "applications": [
    {
      "packageName": "com.something",
      "installType": "KIOSK",
      "defaultPermissionPolicy": "GRANT",
      "minimumVersionCode": 30
    }
  ],

...

  "systemUpdate": {
    "type": "WINDOWED",
    "startMinutes": 0,
    "endMinutes": 1439
  },

...

}

I'm worried that the above won't work (or more correctly, will work intermittently), if the API just randomises a time when the particular device is never powered on.

I'm just wondering how to manage this problem. Should I just have one policy for all devices, and increment the version code?


回答1:


Just to follow up, my previously suggested approach of only changing policies when the device is currently online (and has been online for 5 minutes) is working well. Yay.

Devices are no longer factory resetting themselves if they've been offline for a period of time. It seems to be the combination of a policy change while the device has been offline that's the problem, presumably also due to the fact that the software update isn't instantaneous.



来源:https://stackoverflow.com/questions/59086669/kiosk-app-updates-when-device-not-online-at-consistent-times

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!