File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
sdk/mobile-center-distribute/src
main/java/com/microsoft/azure/mobile/distribute
test/java/com/microsoft/azure/mobile/distribute Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -1306,8 +1306,17 @@ private void showDownloadProgress() {
13061306 */
13071307 private synchronized void hideProgressDialog () {
13081308 if (mProgressDialog != null ) {
1309- mProgressDialog . hide () ;
1309+ final ProgressDialog progressDialog = mProgressDialog ;
13101310 mProgressDialog = null ;
1311+
1312+ /* This can be called from background check download task. */
1313+ HandlerUtils .runOnUiThread (new Runnable () {
1314+
1315+ @ Override
1316+ public void run () {
1317+ progressDialog .hide ();
1318+ }
1319+ });
13111320 HandlerUtils .getMainHandler ().removeCallbacksAndMessages (HANDLER_TOKEN_CHECK_PROGRESS );
13121321 }
13131322 }
Original file line number Diff line number Diff line change @@ -291,10 +291,17 @@ public Void answer(InvocationOnMock invocation) throws Throwable {
291291 }).when (mContext ).startActivity (installIntent );
292292 doAnswer (new Answer <Void >() {
293293
294+ boolean firstCall = true ;
295+
294296 @ Override
295297 public Void answer (InvocationOnMock invocation ) throws Throwable {
296- beforeStartingActivityLock .release ();
297- disabledLock .acquireUninterruptibly ();
298+
299+ /* First call is update progress dialog, second is hide. */
300+ if (firstCall ) {
301+ firstCall = false ;
302+ beforeStartingActivityLock .release ();
303+ disabledLock .acquireUninterruptibly ();
304+ }
298305 (((Runnable ) invocation .getArguments ()[0 ])).run ();
299306 return null ;
300307 }
You can’t perform that action at this time.
0 commit comments