/// <summary> /// Create information about a new .apk /// NOTE: This constructor is called with ActivityThread's lock held, /// so MUST NOT call back out to the activity manager. /// </summary> /// <remarks> /// Create information about a new .apk /// NOTE: This constructor is called with ActivityThread's lock held, /// so MUST NOT call back out to the activity manager. /// </remarks> public LoadedApk(android.app.ActivityThread activityThread, android.content.pm.ApplicationInfo aInfo, android.content.res.CompatibilityInfo compatInfo, android.app.ActivityThread mainThread, java.lang.ClassLoader baseLoader, bool securityViolation, bool includeCode ) { mActivityThread = activityThread; mApplicationInfo = aInfo; mPackageName = aInfo.packageName; mAppDir = aInfo.sourceDir; mResDir = aInfo.uid == android.os.Process.myUid() ? aInfo.sourceDir : aInfo.publicSourceDir; mSharedLibraries = aInfo.sharedLibraryFiles; mDataDir = aInfo.dataDir; mDataDirFile = mDataDir != null ? new java.io.File(mDataDir) : null; mLibDir = aInfo.nativeLibraryDir; mBaseClassLoader = baseLoader; mSecurityViolation = securityViolation; mIncludeCode = includeCode; mCompatibilityInfo.set(compatInfo); if (mAppDir == null) { if (android.app.ActivityThread.mSystemContext == null) { android.app.ActivityThread.mSystemContext = android.app.ContextImpl.createSystemContext (mainThread); android.app.ActivityThread.mSystemContext.getResources().updateConfiguration(mainThread .getConfiguration(), mainThread.getDisplayMetricsLocked(compatInfo, false), compatInfo ); } //Slog.i(TAG, "Created system resources " // + mSystemContext.getResources() + ": " // + mSystemContext.getResources().getConfiguration()); mClassLoader = android.app.ActivityThread.mSystemContext.getClassLoader(); mResources = android.app.ActivityThread.mSystemContext.getResources(); } }
public android.content.res.Resources getResources(android.app.ActivityThread mainThread ) { if (mResources == null) { mResources = mainThread.getTopLevelResources(mResDir, this); } return(mResources); }
/// <summary> /// Perform instantiation of an /// <see cref="Activity">Activity</see> /// object. This method is intended for use with /// unit tests, such as android.test.ActivityUnitTestCase. The activity will be useable /// locally but will be missing some of the linkages necessary for use within the sytem. /// </summary> /// <param name="clazz">The Class of the desired Activity</param> /// <param name="context">The base context for the activity to use</param> /// <param name="token">The token for this activity to communicate with</param> /// <param name="application">The application object (if any)</param> /// <param name="intent">The intent that started this Activity</param> /// <param name="info">ActivityInfo from the manifest</param> /// <param name="title">The title, typically retrieved from the ActivityInfo record</param> /// <param name="parent">The parent Activity (if any)</param> /// <param name="id">The embedded Id (if any)</param> /// <param name="lastNonConfigurationInstance"> /// Arbitrary object that will be /// available via /// <see cref="Activity.getLastNonConfigurationInstance()">Activity.getLastNonConfigurationInstance() /// </see> /// . /// </param> /// <returns>Returns the instantiated activity</returns> /// <exception cref="java.lang.InstantiationException">java.lang.InstantiationException /// </exception> /// <exception cref="System.MemberAccessException">System.MemberAccessException</exception> public virtual android.app.Activity newActivity <_T0>(android.content.Context context , android.os.IBinder token, android.app.Application application, android.content.Intent intent, android.content.pm.ActivityInfo info, java.lang.CharSequence title, android.app.Activity parent, string id, object lastNonConfigurationInstance) { System.Type clazz = typeof(_T0); android.app.Activity activity = (android.app.Activity)System.Activator.CreateInstance (clazz); android.app.ActivityThread aThread = null; activity.attach(context, aThread, this, token, application, intent, info, title, parent, id, (android.app.Activity.NonConfigurationInstances)lastNonConfigurationInstance , new android.content.res.Configuration()); return(activity); }
public LoadedApk(android.app.ActivityThread activityThread, string name, android.content.Context systemContext, android.content.pm.ApplicationInfo info, android.content.res.CompatibilityInfo compatInfo) { mActivityThread = activityThread; mApplicationInfo = info != null ? info : new android.content.pm.ApplicationInfo(); mApplicationInfo.packageName = name; mPackageName = name; mAppDir = null; mResDir = null; mSharedLibraries = null; mDataDir = null; mDataDirFile = null; mLibDir = null; mBaseClassLoader = null; mSecurityViolation = false; mIncludeCode = true; mClassLoader = systemContext.getClassLoader(); mResources = systemContext.getResources(); mCompatibilityInfo.set(compatInfo); }
internal void init(android.app.ActivityThread thread, android.content.Context instrContext , android.content.Context appContext, android.content.ComponentName component, android.app.IInstrumentationWatcher watcher) { throw new System.NotImplementedException(); }
internal void attach(android.content.Context context, android.app.ActivityThread aThread, android.app.Instrumentation instr, android.os.IBinder token, int ident, android.app.Application application, android.content.Intent intent, android.content.pm.ActivityInfo info, java.lang.CharSequence title, android.app.Activity parent, string id, android.app.Activity .NonConfigurationInstances lastNonConfigurationInstances, android.content.res.Configuration config) { attachBaseContext(context); mFragments.attachActivity(this); mWindow = [email protected](this); mWindow.setCallback(this); mWindow.getLayoutInflater().setPrivateFactory(this); if (info.softInputMode != android.view.WindowManagerClass.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED) { mWindow.setSoftInputMode(info.softInputMode); } if (info.uiOptions != 0) { mWindow.setUiOptions(info.uiOptions); } mUiThread = java.lang.Thread.currentThread(); mMainThread = aThread; mInstrumentation = instr; mToken = token; mIdent = ident; mApplication = application; mIntent = intent; mComponent = intent.getComponent(); mActivityInfo = info; mTitle = title; mParent = parent; mEmbeddedID = id; mLastNonConfigurationInstances = lastNonConfigurationInstances; mWindow.setWindowManager(null, mToken, mComponent.flattenToString(), (info.flags & android.content.pm.ActivityInfo.FLAG_HARDWARE_ACCELERATED) != 0); if (mParent != null) { mWindow.setContainer(mParent.getWindow()); } mWindowManager = mWindow.getWindowManager(); mCurrentConfig = config; }
public android.content.res.AssetManager getAssets(android.app.ActivityThread mainThread ) { return(getResources(mainThread).getAssets()); }
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 ); }
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); }
/// <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; }
public void attach(android.content.Context context, android.app.ActivityThread thread , string className, android.os.IBinder token, android.app.Application application , object activityManager) { throw new System.NotImplementedException(); }