Page MenuHomePhabricator

Improve retention of customized 'preload' APK ID
Closed, ResolvedPublic3 Estimated Story Points

Description

With the frequent updates of the Android APK and lead times of device preloads, we need to retain the preload identification even if the app is updated prior to the first run of that app.

Event Timeline

DFoy raised the priority of this task from to Needs Triage.
DFoy updated the task description. (Show Details)
DFoy subscribed.
dr0ptp4kt moved this task from Feature to Doing on the Reading-Admin board.
dr0ptp4kt moved this task from Doing to Next Quarter Candidates on the Reading-Admin board.

I must reverse my preference on implementation. Unpacking and reading the contents of the apk is quite doable and requires no additional permissions. However, the only practical mechanism I know of for the seemingly simple task of locating the original ROM apk requires the android.permission.DUMP permission which is inadvisable. We can manually search for our own apk but this may be error prone. For this reason, I recommend approach #2. If we're willing to tolerate some failures or cannot add a permission, #1 is doable.

  1. Unpack the ID from the original apk file.

    Pro:
    • No additional permission is necessary.

      Con:
    • Manually finding the apk may be unreliable if the apk file is renamed.
  1. Add a distinct ACTION_BOOT_COMPLETED broadcast receiver and permission. Record and / or transmit the preload ID. Disable the broadcast receiver so subsequent boots are unaffected. Note: this intent will not be received for store installs.

    Pro:
    • It's possible to identify the number of users with the preinstall that don't actually use the app.
    • Implementation should be reliable and cleaner than alternatives.

      Con:
    • An extra permission is necessary.

Change 264409 had a related patch set uploaded (by Niedzielski):
Retain preload channel ID

https://gerrit.wikimedia.org/r/264409

Change 264409 merged by jenkins-bot:
Retain preload channel ID

https://gerrit.wikimedia.org/r/264409