Loading services/core/java/com/android/server/StorageManagerService.java +59 −34 Original line number Diff line number Diff line Loading @@ -1074,6 +1074,15 @@ class StorageManagerService extends IStorageManager.Stub mVold.onUserStarted(userId, packages, appIds, sandboxIds); } private boolean supportsBlockCheckpoint() throws RemoteException { // Only the system process is permitted to start checkpoints if (Binder.getCallingUid() != android.os.Process.SYSTEM_UID) { throw new SecurityException("no permission to check block based checkpoint support"); } return mVold.supportsBlockCheckpoint(); } @Override public void onAwakeStateChanged(boolean isAwake) { // Ignored Loading Loading @@ -2116,6 +2125,11 @@ class StorageManagerService extends IStorageManager.Stub enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS); try { // Block based checkpoint process runs fstrim. So, if checkpoint is in progress // (first boot after OTA), We skip idle maintenance and make sure the last // fstrim time is still updated. If file based checkpoints are used, we run // idle maintenance (GC + fstrim) regardless of checkpoint status. if (!needsCheckpoint() || !supportsBlockCheckpoint()) { mVold.fstrim(flags, new IVoldTaskListener.Stub() { @Override public void onStatus(int status, PersistableBundle extras) { Loading Loading @@ -2147,6 +2161,9 @@ class StorageManagerService extends IStorageManager.Stub // TODO: benchmark when desired } }); } else { Slog.i(TAG, "Skipping fstrim - block based checkpoint in progress"); } } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } Loading @@ -2156,6 +2173,11 @@ class StorageManagerService extends IStorageManager.Stub enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS); try { // Block based checkpoint process runs fstrim. So, if checkpoint is in progress // (first boot after OTA), We skip idle maintenance and make sure the last // fstrim time is still updated. If file based checkpoints are used, we run // idle maintenance (GC + fstrim) regardless of checkpoint status. if (!needsCheckpoint() || !supportsBlockCheckpoint()) { mVold.runIdleMaint(new IVoldTaskListener.Stub() { @Override public void onStatus(int status, PersistableBundle extras) { Loading @@ -2168,6 +2190,9 @@ class StorageManagerService extends IStorageManager.Stub } } }); } else { Slog.i(TAG, "Skipping idle maintenance - block based checkpoint in progress"); } } catch (Exception e) { Slog.wtf(TAG, e); } Loading Loading
services/core/java/com/android/server/StorageManagerService.java +59 −34 Original line number Diff line number Diff line Loading @@ -1074,6 +1074,15 @@ class StorageManagerService extends IStorageManager.Stub mVold.onUserStarted(userId, packages, appIds, sandboxIds); } private boolean supportsBlockCheckpoint() throws RemoteException { // Only the system process is permitted to start checkpoints if (Binder.getCallingUid() != android.os.Process.SYSTEM_UID) { throw new SecurityException("no permission to check block based checkpoint support"); } return mVold.supportsBlockCheckpoint(); } @Override public void onAwakeStateChanged(boolean isAwake) { // Ignored Loading Loading @@ -2116,6 +2125,11 @@ class StorageManagerService extends IStorageManager.Stub enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS); try { // Block based checkpoint process runs fstrim. So, if checkpoint is in progress // (first boot after OTA), We skip idle maintenance and make sure the last // fstrim time is still updated. If file based checkpoints are used, we run // idle maintenance (GC + fstrim) regardless of checkpoint status. if (!needsCheckpoint() || !supportsBlockCheckpoint()) { mVold.fstrim(flags, new IVoldTaskListener.Stub() { @Override public void onStatus(int status, PersistableBundle extras) { Loading Loading @@ -2147,6 +2161,9 @@ class StorageManagerService extends IStorageManager.Stub // TODO: benchmark when desired } }); } else { Slog.i(TAG, "Skipping fstrim - block based checkpoint in progress"); } } catch (RemoteException e) { throw e.rethrowAsRuntimeException(); } Loading @@ -2156,6 +2173,11 @@ class StorageManagerService extends IStorageManager.Stub enforcePermission(android.Manifest.permission.MOUNT_FORMAT_FILESYSTEMS); try { // Block based checkpoint process runs fstrim. So, if checkpoint is in progress // (first boot after OTA), We skip idle maintenance and make sure the last // fstrim time is still updated. If file based checkpoints are used, we run // idle maintenance (GC + fstrim) regardless of checkpoint status. if (!needsCheckpoint() || !supportsBlockCheckpoint()) { mVold.runIdleMaint(new IVoldTaskListener.Stub() { @Override public void onStatus(int status, PersistableBundle extras) { Loading @@ -2168,6 +2190,9 @@ class StorageManagerService extends IStorageManager.Stub } } }); } else { Slog.i(TAG, "Skipping idle maintenance - block based checkpoint in progress"); } } catch (Exception e) { Slog.wtf(TAG, e); } Loading