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

Commit 1783f149 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Avoid deadlock when FSTRIM requested at boot.

When PackageManager decides that FSTRIM is required at boot, we
can end up in deadlock.  Work around this for now by kicking the
requested FSTRIM can down the road for a few seconds until we're
connected to vold.

Bug: 20228019
Change-Id: I47e422e618d99e59aed8a8b79227821a3012eb9f
parent f645f942
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ import android.os.storage.StorageResultCode;
import android.os.storage.StorageVolume;
import android.os.storage.VolumeInfo;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.ArrayMap;
import android.util.AtomicFile;
import android.util.DebugUtils;
@@ -533,7 +534,11 @@ class MountService extends IMountService.Stub
                    break;
                }
                case H_FSTRIM: {
                    waitForReady();
                    if (!isReady()) {
                        Slog.i(TAG, "fstrim requested, but no daemon connection yet; trying again");
                        sendMessageDelayed(obtainMessage(H_FSTRIM), DateUtils.SECOND_IN_MILLIS);
                    }

                    Slog.i(TAG, "Running fstrim idle maintenance");

                    // Remember when we kicked it off