summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorFyodor Kupolov <fkupolov@google.com>2015-04-02 12:42:13 -0700
committerFyodor Kupolov <fkupolov@google.com>2015-04-03 09:28:44 -0700
commit6f34d363c32ec3295fd77257648d1291ea31c33f (patch)
tree7338a63f522bc3d076c8f3e124513ccaf0dcdea4 /services/devicepolicy
parent3425dae8dc63372e8944dce43f7ed2d567512248 (diff)
downloadframeworks_base-6f34d363c32ec3295fd77257648d1291ea31c33f.zip
frameworks_base-6f34d363c32ec3295fd77257648d1291ea31c33f.tar.gz
frameworks_base-6f34d363c32ec3295fd77257648d1291ea31c33f.tar.bz2
Do not log an error when app restriction file does not exist
Bug: 20040207 Change-Id: Ibd257388a185020258e36bddf5b451dc24c0b7ee
Diffstat (limited to 'services/devicepolicy')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 0c58aef..eac046f 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -5050,7 +5050,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
long id = Binder.clearCallingIdentity();
try {
- return mUserManager.getApplicationRestrictions(packageName, userHandle);
+ Bundle bundle = mUserManager.getApplicationRestrictions(packageName, userHandle);
+ // if no restrictions were saved, mUserManager.getApplicationRestrictions
+ // returns null, but DPM method should return an empty Bundle as per JavaDoc
+ return bundle != null ? bundle : Bundle.EMPTY;
} finally {
restoreCallingIdentity(id);
}