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

Commit 7cfa9c67 authored by Omar Eissa's avatar Omar Eissa Committed by Android (Google) Code Review
Browse files

Merge "Add tracing points to StorageManagerService" into main

parents fcf5c037 08791b8b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ import android.os.ServiceManager;
import android.os.ServiceSpecificException;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.DiskInfo;
@@ -1180,6 +1181,7 @@ class StorageManagerService extends IStorageManager.Stub

    private void onUserUnlocking(int userId) {
        Slog.d(TAG, "onUserUnlocking " + userId);
        Trace.instant(Trace.TRACE_TAG_SYSTEM_SERVER, "SMS.onUserUnlocking: " + userId);

        if (userId != UserHandle.USER_SYSTEM) {
            // Check if this user shares media with another user
@@ -1466,6 +1468,8 @@ class StorageManagerService extends IStorageManager.Stub
        @Override
        public void onVolumeCreated(String volId, int type, String diskId, String partGuid,
                int userId) {
            Trace.instant(Trace.TRACE_TAG_SYSTEM_SERVER,
                    "SMS.onVolumeCreated: " + volId + ", " + userId);
            synchronized (mLock) {
                final DiskInfo disk = mDisks.get(diskId);
                final VolumeInfo vol = new VolumeInfo(volId, type, disk, partGuid);
@@ -2352,6 +2356,7 @@ class StorageManagerService extends IStorageManager.Stub

    private void mount(VolumeInfo vol) {
        try {
            Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER, "SMS.mount: " + vol.id);
            // TODO(b/135341433): Remove cautious logging when FUSE is stable
            Slog.i(TAG, "Mounting volume " + vol);
            extendWatchdogTimeout("#mount might be slow");
@@ -2363,6 +2368,8 @@ class StorageManagerService extends IStorageManager.Stub
                    vol.internalPath = internalPath;
                    ParcelFileDescriptor pfd = new ParcelFileDescriptor(fd);
                    try {
                        Trace.traceBegin(Trace.TRACE_TAG_SYSTEM_SERVER,
                                "SMS.startFuseFileSystem: " + vol.id);
                        mStorageSessionController.onVolumeMount(pfd, vol);
                        return true;
                    } catch (ExternalStorageServiceException e) {
@@ -2375,6 +2382,7 @@ class StorageManagerService extends IStorageManager.Stub
                                TimeUnit.SECONDS.toMillis(nextResetSeconds));
                        return false;
                    } finally {
                        Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
                        try {
                            pfd.close();
                        } catch (Exception e) {
@@ -2386,6 +2394,8 @@ class StorageManagerService extends IStorageManager.Stub
            Slog.i(TAG, "Mounted volume " + vol);
        } catch (Exception e) {
            Slog.wtf(TAG, e);
        } finally {
            Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
        }
    }