diff options
Diffstat (limited to 'core/java/android/app/ContextImpl.java')
-rw-r--r-- | core/java/android/app/ContextImpl.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 73170bb..20dc792 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -425,11 +425,19 @@ class ContextImpl extends Context { registerService(WINDOW_SERVICE, new ServiceFetcher() { public Object getService(ContextImpl ctx) { - CompatibilityInfo ci = ctx.mResources.getCompatibilityInfo(); - return WindowManagerImpl.getDefault(ci); + return WindowManagerImpl.getDefault(ctx.mPackageInfo.mCompatibilityInfo); }}); } + static ContextImpl getImpl(Context context) { + Context nextContext; + while ((context instanceof ContextWrapper) && + (nextContext=((ContextWrapper)context).getBaseContext()) != null) { + context = nextContext; + } + return (ContextImpl)context; + } + // The system service cache for the system services that are // cached per-ContextImpl. Package-scoped to avoid accessor // methods. |