Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08e40b85 authored by Christopher Tate's avatar Christopher Tate
Browse files

Fix Bmgr's logic around restore completion

The caller needs to wait for the restore observer to be informed that the
restore has finished processing before it can safely shut down the restore
session.
parent 8851e163
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -327,11 +327,6 @@ public final class Bmgr {
                    printRestoreSets(sets);
                }
            }
            mRestore.endRestoreSession();
        } catch (RemoteException e) {
            System.err.println(e.toString());
            System.err.println(BMGR_NOT_RUNNING_ERR);
        }

            // now wait for it to be done
            synchronized (observer) {
@@ -342,6 +337,14 @@ public final class Bmgr {
                    }
                }
            }

            // once the restore has finished, close down the session and we're done
            mRestore.endRestoreSession();
        } catch (RemoteException e) {
            System.err.println(e.toString());
            System.err.println(BMGR_NOT_RUNNING_ERR);
        }

        System.out.println("done");
    }