Esempio n. 1
0
		internal void init(android.app.LoadedApk packageInfo, android.os.IBinder activityToken
			, android.app.ActivityThread mainThread, android.content.res.Resources container
			, string basePackageName)
		{
			mPackageInfo = packageInfo;
			mBasePackageName = basePackageName != null ? basePackageName : packageInfo.mPackageName;
			mResources = mPackageInfo.getResources(mainThread);
			if (mResources != null && container != null && container.getCompatibilityInfo().applicationScale
				 != mResources.getCompatibilityInfo().applicationScale)
			{
				mResources = mainThread.getTopLevelResources(mPackageInfo.getResDir(), container.
					getCompatibilityInfo());
			}
			mMainThread = mainThread;
			mContentResolver = new android.app.ContextImpl.ApplicationContentResolver(this, mainThread
				);
			setActivityToken(activityToken);
		}
Esempio n. 2
0
		internal void init(android.content.res.Resources resources, android.app.ActivityThread
			 mainThread)
		{
			mPackageInfo = null;
			mBasePackageName = null;
			mResources = resources;
			mMainThread = mainThread;
			mContentResolver = new android.app.ContextImpl.ApplicationContentResolver(this, mainThread
				);
		}
Esempio n. 3
0
		/// <summary>Create a new ApplicationContext from an existing one.</summary>
		/// <remarks>
		/// Create a new ApplicationContext from an existing one.  The new one
		/// works and operates the same as the one it is copying.
		/// </remarks>
		/// <param name="context">Existing application context.</param>
		internal ContextImpl(android.app.ContextImpl context)
		{
			mPackageInfo = context.mPackageInfo;
			mBasePackageName = context.mBasePackageName;
			mResources = context.mResources;
			mMainThread = context.mMainThread;
			mContentResolver = context.mContentResolver;
			mOuterContext = this;
		}