androidgoogle-playdynamic-feature-moduledynamic-feature

Android Feature modules Confirmation dialogue testing


I am trying to test the Feature modules confirmation dialogue prompt. So as per Android docs, when the install request is made, we would get the REQUIRES_USER_CONFIRMATION state in the state listener, and then we have to invoke startConfirmationDialogForResult API.

But when I make an install request for the feature module, the feature module is downloaded without the REQUIRES_USER_CONFIRMATION state. How can we simulate this?

I am using Google Internal App sharing mode to test my App and also size of my feature module is greater than 50MB.


Solution

  • Below weird way helped me to simulate the REQUIRES_USER_CONFIRMATION state.

    1. While the feature module is being downloaded, stopped the download from the play store and then again I initiated the feature module download from my Application. Then at this step, I am getting REQUIRES_USER_CONFIRMATION state.

    2. The above approach worked only in low-end Samsung device which I have, but not in the Pixel device. Initially, I thought device low storage might be a factor, so I made my pixel device a low storage one, but this doesnt help.

    Note : Below Google bug has more info related to the Confirmation dialogue. As per below link, there are discrepancies if we are on WIFI or Mobile Data. Good to go through below link

    https://issuetracker.google.com/issues/171501820