Solution 1 :
I had printed logs-
DynamicDeliveryUtils->downloadAndInstallModule() addOnSuccessListener module=optionalFeature1
DynamicDeliveryUtils->downloadAndInstallModule() addOnCompleteListener module=optionalFeature1
DynamicDeliveryUtils->downloadAndInstallModule() PENDING module=optionalFeature1
DynamicDeliveryUtils->downloadAndInstallModule() DOWNLOADING module=optionalFeature1
DynamicDeliveryUtils->downloadAndInstallModule() DOWNLOADING module=optionalFeature1
DynamicDeliveryUtils->downloadAndInstallModule() DOWNLOADING module=optionalFeature1
DynamicDeliveryUtils->downloadAndInstallModule() INSTALLING module=optionalFeature1
DynamicDeliveryUtils->downloadAndInstallModule() INSTALLED module=optionalFeature1
As you can see addOnSuccessListener
and addOnCompleteListener
are called immediately. Module goes to pending, downloading, installing and installed state. I have redirected my optional module screen that and it is working fine so you should write your code in INSTALLED
state.
when (splitInstallSessionState.status()) {
SplitInstallSessionStatus.INSTALLED -> {
//module has been installed, now redirect to module screen
}
}
Problem :
1596788538.956 20445-20445/com.tscore.app I/PlayCore: UID: [10198] PID: [20445] SplitInstallService : startInstall([aadhar_module],[])
1596788538.957 20445-21761/com.tscore.app I/PlayCore: UID: [10198] PID: [20445] SplitInstallService : Initiate binding to the service.
1596788538.968 20445-20445/com.tscore.app I/PlayCore: UID: [10198] PID: [20445] SplitInstallService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.splitinstallservice.SplitInstallService})
1596788538.968 20445-21761/com.tscore.app I/PlayCore: UID: [10198] PID: [20445] SplitInstallService : linkToDeath
1596788539.009 20445-21761/com.tscore.app I/PlayCore: UID: [10198] PID: [20445] SplitInstallService : Unbind from service.
1596788539.010 20445-22722/com.tscore.app I/PlayCore: UID: [10198] PID: [20445] SplitInstallService : onStartInstall(28)
1596788539.013 20445-20445/com.tscore.app D/HwRTBlurUtils: check blur style for HwToast-Toast, themeResId : 0x0103013f, context : [email protected], Nhwext : 6, get Blur : disable with , [email protected]
1596788539.024 20445-20445/com.tscore.app D/HwRTBlurUtils: check blur style for HwToast-Toast, themeResId : 0x0103013f, context : [email protected], Nhwext : 6, get Blur : disable with , [email protected]
1596788539.034 20445-20445/com.tscore.app D/HwRTBlurUtils: check blur style for HwToast-Toast, themeResId : 0x0103013f, context : [email protected], Nhwext : 6, get Blur : disable with , [email protected]
1596788539.048 20445-20524/com.tscore.app D/OpenGLRenderer: HWUI Binary is disabled
1596788539.058 20445-20445/com.tscore.app W/ViewRootImpl[Toast]: EGLdebug relayoutWindow Surface isSurface(name=null) (appName =com.tscore.app) ( mSurfaceControllerIsValid =false) (mNativeObject =0)/@0xc2b8284,viewVisibility is0
1596788539.080 20445-20445/com.tscore.app W/ViewRootImpl[Toast]: EGLdebug relayoutWindow Surface isSurface(name=null) (appName =com.tscore.app) ( mSurfaceControllerIsValid =true) (mNativeObject =73173e5000)/@0xc2b8284,relayoutResult is7
1596788539.080 20445-20445/com.tscore.app W/ViewRootImpl[Toast]: EGLdebug Surface isSurface(name=null) (appName =com.tscore.app) ( mSurfaceControllerIsValid =true) (mNativeObject =73173e5000)/@0xc2b8284