Merge "Guard against null Context in attachInfo()." into klp-dev

This commit is contained in:
Jeff Sharkey
2013-09-17 22:38:17 +00:00
committed by Android (Google) Code Review

View File

@@ -1573,8 +1573,10 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
*/
if (mContext == null) {
mContext = context;
mTransport.mAppOpsManager = (AppOpsManager) mContext.getSystemService(
Context.APP_OPS_SERVICE);
if (context != null) {
mTransport.mAppOpsManager = (AppOpsManager) context.getSystemService(
Context.APP_OPS_SERVICE);
}
mMyUid = Process.myUid();
if (info != null) {
setReadPermission(info.readPermission);