Skip to content

Commit f882efa

Browse files
author
Dianne Hackborn
committed
Fix issue #6266651: Low storage warning takes long time to sort apps by usage
On a device with emulated external storage, the low storage notification should go to the main storage settings UI. This shows the user all of the things that could be causing their storage to be low. Change-Id: I9c345b6cb7abbabc24a67c7e104d077ecbbfb86d
1 parent 50a9267 commit f882efa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import android.content.pm.IPackageDataObserver;
2626
import android.content.pm.IPackageManager;
2727
import android.os.Binder;
28+
import android.os.Environment;
2829
import android.os.Handler;
2930
import android.os.Message;
3031
import android.os.Process;
@@ -336,7 +337,9 @@ private final void sendNotification() {
336337
//log the event to event log with the amount of free storage(in bytes) left on the device
337338
EventLog.writeEvent(EventLogTags.LOW_STORAGE, mFreeMem);
338339
// Pack up the values and broadcast them to everyone
339-
Intent lowMemIntent = new Intent(Intent.ACTION_MANAGE_PACKAGE_STORAGE);
340+
Intent lowMemIntent = new Intent(Environment.isExternalStorageEmulated()
341+
? Settings.ACTION_INTERNAL_STORAGE_SETTINGS
342+
: Intent.ACTION_MANAGE_PACKAGE_STORAGE);
340343
lowMemIntent.putExtra("memory", mFreeMem);
341344
lowMemIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
342345
NotificationManager mNotificationMgr =

0 commit comments

Comments
 (0)