File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
services/java/com/android/server/pm Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -376,4 +376,7 @@ interface IPackageManager {
376376
377377 void setPermissionEnforced (String permission , boolean enforced );
378378 boolean isPermissionEnforced (String permission );
379+
380+ /** Reflects current DeviceStorageMonitorService state */
381+ boolean isStorageLow ();
379382}
Original file line number Diff line number Diff line change 27052705 <string name =" editTextMenuTitle" >Text actions</string >
27062706
27072707 <!-- If the device is getting low on internal storage, a notification is shown to the user. This is the title of that notification. -->
2708- <string name =" low_internal_storage_view_title" >Low on space</string >
2708+ <string name =" low_internal_storage_view_title" >Storage space running out </string >
27092709 <!-- If the device is getting low on internal storage, a notification is shown to the user. This is the message of that notification. -->
2710- <string name =" low_internal_storage_view_text" product =" tablet" >Tablet storage space is getting low.</string >
2711- <!-- If the device is getting low on internal storage, a notification is shown to the user. This is the message of that notification. -->
2712- <string name =" low_internal_storage_view_text" product =" default" >Phone storage space is getting low.</string >
2710+ <string name =" low_internal_storage_view_text" >Some system functions may not work</string >
27132711
27142712 <!-- Preference framework strings. -->
27152713 <string name =" ok" >OK</string >
Original file line number Diff line number Diff line change @@ -9397,4 +9397,15 @@ private boolean isPermissionEnforcedLocked(String permission) {
93979397 return true ;
93989398 }
93999399 }
9400+
9401+ public boolean isStorageLow () {
9402+ final long token = Binder .clearCallingIdentity ();
9403+ try {
9404+ final DeviceStorageMonitorService dsm = (DeviceStorageMonitorService ) ServiceManager
9405+ .getService (DeviceStorageMonitorService .SERVICE );
9406+ return dsm .isMemoryLow ();
9407+ } finally {
9408+ Binder .restoreCallingIdentity (token );
9409+ }
9410+ }
94009411}
You can’t perform that action at this time.
0 commit comments