Loading core/java/android/accounts/AccountAuthenticatorCache.java +4 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.accounts; import android.content.pm.PackageManager; import android.content.pm.RegisteredServicesCache; import android.content.pm.XmlSerializerAndParser; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.Context; import android.util.AttributeSet; Loading Loading @@ -47,8 +48,9 @@ import java.io.IOException; AccountManager.AUTHENTICATOR_ATTRIBUTES_NAME, sSerializer); } public AuthenticatorDescription parseServiceAttributes(String packageName, AttributeSet attrs) { TypedArray sa = mContext.getResources().obtainAttributes(attrs, public AuthenticatorDescription parseServiceAttributes(Resources res, String packageName, AttributeSet attrs) { TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.AccountAuthenticator); try { final String accountType = Loading core/java/android/app/WallpaperInfo.java +8 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,9 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources.NotFoundException; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.drawable.Drawable; Loading Loading @@ -96,6 +98,8 @@ public final class WallpaperInfo implements Parcelable { + WallpaperService.SERVICE_META_DATA + " meta-data"); } Resources res = pm.getResourcesForApplication(si.applicationInfo); AttributeSet attrs = Xml.asAttributeSet(parser); int type; Loading @@ -109,7 +113,7 @@ public final class WallpaperInfo implements Parcelable { "Meta-data does not start with wallpaper tag"); } TypedArray sa = context.getResources().obtainAttributes(attrs, TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.Wallpaper); settingsActivityComponent = sa.getString( com.android.internal.R.styleable.Wallpaper_settingsActivity); Loading @@ -125,6 +129,9 @@ public final class WallpaperInfo implements Parcelable { -1); sa.recycle(); } catch (NameNotFoundException e) { throw new XmlPullParserException( "Unable to create context for: " + si.packageName); } finally { if (parser != null) parser.close(); } Loading core/java/android/app/admin/DeviceAdminInfo.java +8 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.content.res.Resources.NotFoundException; Loading Loading @@ -181,6 +183,8 @@ public final class DeviceAdminInfo implements Parcelable { + DeviceAdminReceiver.DEVICE_ADMIN_META_DATA + " meta-data"); } Resources res = pm.getResourcesForApplication(ai.applicationInfo); AttributeSet attrs = Xml.asAttributeSet(parser); int type; Loading @@ -194,7 +198,7 @@ public final class DeviceAdminInfo implements Parcelable { "Meta-data does not start with device-admin tag"); } TypedArray sa = context.getResources().obtainAttributes(attrs, TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.DeviceAdmin); mVisible = sa.getBoolean( Loading Loading @@ -227,6 +231,9 @@ public final class DeviceAdminInfo implements Parcelable { } } } } catch (NameNotFoundException e) { throw new XmlPullParserException( "Unable to create context for: " + ai.packageName); } finally { if (parser != null) parser.close(); } Loading core/java/android/content/SyncAdaptersCache.java +4 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.content; import android.content.pm.RegisteredServicesCache; import android.content.pm.XmlSerializerAndParser; import android.content.res.Resources; import android.content.res.TypedArray; import android.util.AttributeSet; import org.xmlpull.v1.XmlPullParser; Loading @@ -42,8 +43,9 @@ import java.io.IOException; super(context, SERVICE_INTERFACE, SERVICE_META_DATA, ATTRIBUTES_NAME, sSerializer); } public SyncAdapterType parseServiceAttributes(String packageName, AttributeSet attrs) { TypedArray sa = mContext.getResources().obtainAttributes(attrs, public SyncAdapterType parseServiceAttributes(Resources res, String packageName, AttributeSet attrs) { TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.SyncAdapter); try { final String authority = Loading core/java/android/content/pm/RegisteredServicesCache.java +9 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import android.content.BroadcastReceiver; import android.content.Intent; import android.content.IntentFilter; import android.content.ComponentName; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.os.Environment; import android.os.Handler; Loading Loading @@ -402,7 +404,8 @@ public abstract class RegisteredServicesCache<V> { "Meta-data does not start with " + mAttributesName + " tag"); } V v = parseServiceAttributes(si.packageName, attrs); V v = parseServiceAttributes(pm.getResourcesForApplication(si.applicationInfo), si.packageName, attrs); if (v == null) { return null; } Loading @@ -410,6 +413,9 @@ public abstract class RegisteredServicesCache<V> { final ApplicationInfo applicationInfo = serviceInfo.applicationInfo; final int uid = applicationInfo.uid; return new ServiceInfo<V>(v, componentName, uid); } catch (NameNotFoundException e) { throw new XmlPullParserException( "Unable to load resources for pacakge " + si.packageName); } finally { if (parser != null) parser.close(); } Loading Loading @@ -499,5 +505,6 @@ public abstract class RegisteredServicesCache<V> { } } public abstract V parseServiceAttributes(String packageName, AttributeSet attrs); public abstract V parseServiceAttributes(Resources res, String packageName, AttributeSet attrs); } Loading
core/java/android/accounts/AccountAuthenticatorCache.java +4 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.accounts; import android.content.pm.PackageManager; import android.content.pm.RegisteredServicesCache; import android.content.pm.XmlSerializerAndParser; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.Context; import android.util.AttributeSet; Loading Loading @@ -47,8 +48,9 @@ import java.io.IOException; AccountManager.AUTHENTICATOR_ATTRIBUTES_NAME, sSerializer); } public AuthenticatorDescription parseServiceAttributes(String packageName, AttributeSet attrs) { TypedArray sa = mContext.getResources().obtainAttributes(attrs, public AuthenticatorDescription parseServiceAttributes(Resources res, String packageName, AttributeSet attrs) { TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.AccountAuthenticator); try { final String accountType = Loading
core/java/android/app/WallpaperInfo.java +8 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,9 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources.NotFoundException; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.drawable.Drawable; Loading Loading @@ -96,6 +98,8 @@ public final class WallpaperInfo implements Parcelable { + WallpaperService.SERVICE_META_DATA + " meta-data"); } Resources res = pm.getResourcesForApplication(si.applicationInfo); AttributeSet attrs = Xml.asAttributeSet(parser); int type; Loading @@ -109,7 +113,7 @@ public final class WallpaperInfo implements Parcelable { "Meta-data does not start with wallpaper tag"); } TypedArray sa = context.getResources().obtainAttributes(attrs, TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.Wallpaper); settingsActivityComponent = sa.getString( com.android.internal.R.styleable.Wallpaper_settingsActivity); Loading @@ -125,6 +129,9 @@ public final class WallpaperInfo implements Parcelable { -1); sa.recycle(); } catch (NameNotFoundException e) { throw new XmlPullParserException( "Unable to create context for: " + si.packageName); } finally { if (parser != null) parser.close(); } Loading
core/java/android/app/admin/DeviceAdminInfo.java +8 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,8 @@ import android.content.pm.ActivityInfo; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.content.res.Resources.NotFoundException; Loading Loading @@ -181,6 +183,8 @@ public final class DeviceAdminInfo implements Parcelable { + DeviceAdminReceiver.DEVICE_ADMIN_META_DATA + " meta-data"); } Resources res = pm.getResourcesForApplication(ai.applicationInfo); AttributeSet attrs = Xml.asAttributeSet(parser); int type; Loading @@ -194,7 +198,7 @@ public final class DeviceAdminInfo implements Parcelable { "Meta-data does not start with device-admin tag"); } TypedArray sa = context.getResources().obtainAttributes(attrs, TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.DeviceAdmin); mVisible = sa.getBoolean( Loading Loading @@ -227,6 +231,9 @@ public final class DeviceAdminInfo implements Parcelable { } } } } catch (NameNotFoundException e) { throw new XmlPullParserException( "Unable to create context for: " + ai.packageName); } finally { if (parser != null) parser.close(); } Loading
core/java/android/content/SyncAdaptersCache.java +4 −2 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.content; import android.content.pm.RegisteredServicesCache; import android.content.pm.XmlSerializerAndParser; import android.content.res.Resources; import android.content.res.TypedArray; import android.util.AttributeSet; import org.xmlpull.v1.XmlPullParser; Loading @@ -42,8 +43,9 @@ import java.io.IOException; super(context, SERVICE_INTERFACE, SERVICE_META_DATA, ATTRIBUTES_NAME, sSerializer); } public SyncAdapterType parseServiceAttributes(String packageName, AttributeSet attrs) { TypedArray sa = mContext.getResources().obtainAttributes(attrs, public SyncAdapterType parseServiceAttributes(Resources res, String packageName, AttributeSet attrs) { TypedArray sa = res.obtainAttributes(attrs, com.android.internal.R.styleable.SyncAdapter); try { final String authority = Loading
core/java/android/content/pm/RegisteredServicesCache.java +9 −2 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import android.content.BroadcastReceiver; import android.content.Intent; import android.content.IntentFilter; import android.content.ComponentName; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.os.Environment; import android.os.Handler; Loading Loading @@ -402,7 +404,8 @@ public abstract class RegisteredServicesCache<V> { "Meta-data does not start with " + mAttributesName + " tag"); } V v = parseServiceAttributes(si.packageName, attrs); V v = parseServiceAttributes(pm.getResourcesForApplication(si.applicationInfo), si.packageName, attrs); if (v == null) { return null; } Loading @@ -410,6 +413,9 @@ public abstract class RegisteredServicesCache<V> { final ApplicationInfo applicationInfo = serviceInfo.applicationInfo; final int uid = applicationInfo.uid; return new ServiceInfo<V>(v, componentName, uid); } catch (NameNotFoundException e) { throw new XmlPullParserException( "Unable to load resources for pacakge " + si.packageName); } finally { if (parser != null) parser.close(); } Loading Loading @@ -499,5 +505,6 @@ public abstract class RegisteredServicesCache<V> { } } public abstract V parseServiceAttributes(String packageName, AttributeSet attrs); public abstract V parseServiceAttributes(Resources res, String packageName, AttributeSet attrs); }