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

Commit acaed3d2 authored by pengzhicai's avatar pengzhicai Committed by zhicai peng
Browse files

Fix the deadlock problem

https://code.google.com/p/android/issues/detail?id=229020



Change-Id: Ib08f62dd916d09e666e58fb583555170d1e51da6
Signed-off-by: default avatarpengzhicai <pengzhicai@xiaomi.com>
parent 13c76b77
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2383,16 +2383,15 @@ public class BackupManagerService {
                        } catch (InterruptedException e) {
                            // just bail
                            Slog.w(TAG, "Interrupted: " + e);
                            mActivityManager.clearPendingBackup();
                            return null;
                            mConnecting = false;
                            mConnectedAgent = null;
                        }
                    }

                    // if we timed out with no connect, abort and move on
                    if (mConnecting == true) {
                        Slog.w(TAG, "Timeout waiting for agent " + app);
                        mActivityManager.clearPendingBackup();
                        return null;
                        mConnectedAgent = null;
                    }
                    if (DEBUG) Slog.i(TAG, "got agent " + mConnectedAgent);
                    agent = mConnectedAgent;
@@ -2401,6 +2400,13 @@ public class BackupManagerService {
                // can't happen - ActivityManager is local
            }
        }
        if (agent == null) {
            try {
                mActivityManager.clearPendingBackup();
            } catch (RemoteException e) {
                // can't happen - ActivityManager is local
            }
        }
        return agent;
    }