diff options
| -rw-r--r-- | core/java/android/content/pm/IPackageManager.aidl | 3 | ||||
| -rwxr-xr-x | core/res/res/values/strings.xml | 6 | ||||
| -rw-r--r-- | services/java/com/android/server/pm/PackageManagerService.java | 11 |
3 files changed, 16 insertions, 4 deletions
diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index 70c0c48..90b4247 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -376,4 +376,7 @@ interface IPackageManager { void setPermissionEnforced(String permission, boolean enforced); boolean isPermissionEnforced(String permission); + + /** Reflects current DeviceStorageMonitorService state */ + boolean isStorageLow(); } diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 9861bae..53914a8 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2705,11 +2705,9 @@ <string name="editTextMenuTitle">Text actions</string> <!-- If the device is getting low on internal storage, a notification is shown to the user. This is the title of that notification. --> - <string name="low_internal_storage_view_title">Low on space</string> + <string name="low_internal_storage_view_title">Storage space running out</string> <!-- If the device is getting low on internal storage, a notification is shown to the user. This is the message of that notification. --> - <string name="low_internal_storage_view_text" product="tablet">Tablet storage space is getting low.</string> - <!-- If the device is getting low on internal storage, a notification is shown to the user. This is the message of that notification. --> - <string name="low_internal_storage_view_text" product="default">Phone storage space is getting low.</string> + <string name="low_internal_storage_view_text">Some system functions may not work</string> <!-- Preference framework strings. --> <string name="ok">OK</string> diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 49d2ebd..6643d8c 100644 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -9397,4 +9397,15 @@ public class PackageManagerService extends IPackageManager.Stub { return true; } } + + public boolean isStorageLow() { + final long token = Binder.clearCallingIdentity(); + try { + final DeviceStorageMonitorService dsm = (DeviceStorageMonitorService) ServiceManager + .getService(DeviceStorageMonitorService.SERVICE); + return dsm.isMemoryLow(); + } finally { + Binder.restoreCallingIdentity(token); + } + } } |
