Merge "Solve the infinite loop on clearExternalStorageDataSync" into nyc-dev

This commit is contained in:
TreeHugger Robot
2016-06-10 23:13:51 +00:00
committed by Android (Google) Code Review

View File

@@ -16338,8 +16338,9 @@ public class PackageManagerService extends IPackageManager.Stub {
for (int curUser : users) {
long timeout = SystemClock.uptimeMillis() + 5000;
synchronized (conn) {
long now = SystemClock.uptimeMillis();
while (conn.mContainerService == null && now < timeout) {
long now;
while (conn.mContainerService == null &&
(now = SystemClock.uptimeMillis()) < timeout) {
try {
conn.wait(timeout - now);
} catch (InterruptedException e) {