Skip to content

Commit 4b33092

Browse files
committed
Don't crash when low storage is encountered pre-boot completion.
Bug: 2741633 Change-Id: Ic073ead64ff43b2e2c32b439756cd71c2b6550b8
1 parent 2e3761b commit 4b33092

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

services/java/com/android/server/DeviceStorageMonitorService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ public DeviceStorageMonitorService(Context context) {
280280
mTotalMemory = ((long)mDataFileStats.getBlockCount() *
281281
mDataFileStats.getBlockSize())/100L;
282282
mStorageLowIntent = new Intent(Intent.ACTION_DEVICE_STORAGE_LOW);
283+
mStorageLowIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
283284
mStorageOkIntent = new Intent(Intent.ACTION_DEVICE_STORAGE_OK);
285+
mStorageOkIntent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
284286
checkMemory(true);
285287
}
286288

0 commit comments

Comments
 (0)