Commit 6a8cc730 authored by Bo Liu's avatar Bo Liu Committed by Commit Bot

Ignore getApplicationRestrictions SecurityException

There are a few reports on esoteric android devices where
getApplicationRestrictions may throw SecurityException even though it is
not documented behavior. Just ignore them.

Bug: 886814
Change-Id: Ife0c91f3516ec022912bfb2dc99cfc69ba25f186
Reviewed-on: https://chromium-review.googlesource.com/1235118Reviewed-by: default avatarBartosz Fabianowski <bartfab@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592793}
parent 7b89a95b
...@@ -33,7 +33,12 @@ public class AppRestrictionsProvider extends AbstractAppRestrictionsProvider { ...@@ -33,7 +33,12 @@ public class AppRestrictionsProvider extends AbstractAppRestrictionsProvider {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
protected Bundle getApplicationRestrictions(String packageName) { protected Bundle getApplicationRestrictions(String packageName) {
if (mUserManager == null) return new Bundle(); if (mUserManager == null) return new Bundle();
return mUserManager.getApplicationRestrictions(packageName); try {
return mUserManager.getApplicationRestrictions(packageName);
} catch (SecurityException e) {
// Android bug may throw SecurityException. See crbug.com/886814.
return new Bundle();
}
} }
@Override @Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment