@@ -2443,8 +2443,28 @@ private Provider parseProvider(Package owner, Resources res,
24432443 return null ;
24442444 }
24452445
2446+ boolean providerExportedDefault = false ;
2447+
2448+ if (owner .applicationInfo .targetSdkVersion < Build .VERSION_CODES .JELLY_BEAN_MR1 ) {
2449+ // For compatibility, applications targeting API level 16 or lower
2450+ // should have their content providers exported by default, unless they
2451+ // specify otherwise.
2452+ providerExportedDefault = true ;
2453+ }
2454+
2455+ if (((owner .applicationInfo .flags & ApplicationInfo .FLAG_SYSTEM ) != 0 )
2456+ && (owner .applicationInfo .targetSdkVersion == Build .VERSION_CODES .JELLY_BEAN )) {
2457+ // STOPSHIP: REMOVE THIS IF BLOCK
2458+ // To expose more bugs, pre-installed system apps targeting API level 16
2459+ // should not have their content providers exported by default.
2460+ // This is only a short term check, and should be removed when the
2461+ // default SDK version changes to 17.
2462+ providerExportedDefault = false ;
2463+ }
2464+
24462465 p .info .exported = sa .getBoolean (
2447- com .android .internal .R .styleable .AndroidManifestProvider_exported , true );
2466+ com .android .internal .R .styleable .AndroidManifestProvider_exported ,
2467+ providerExportedDefault );
24482468
24492469 String cpname = sa .getNonConfigurationString (
24502470 com .android .internal .R .styleable .AndroidManifestProvider_authorities , 0 );
@@ -2516,7 +2536,7 @@ private Provider parseProvider(Package owner, Resources res,
25162536 }
25172537
25182538 if (cpname == null ) {
2519- outError [0 ] = "<provider> does not incude authorities attribute" ;
2539+ outError [0 ] = "<provider> does not include authorities attribute" ;
25202540 return null ;
25212541 }
25222542 p .info .authority = cpname .intern ();
0 commit comments