Example #1
0
 public override void resized(int w, int h, android.graphics.Rect coveredInsets, android.graphics.Rect
                              visibleInsets, bool reportDraw, android.content.res.Configuration newConfig)
 {
     android.view.SurfaceView surfaceView = mSurfaceView.get();
     if (surfaceView != null)
     {
         surfaceView.mSurfaceLock.@lock();
         try
         {
             if (reportDraw)
             {
                 surfaceView.mUpdateWindowNeeded = true;
                 surfaceView.mReportDrawNeeded   = true;
                 surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
             }
             else
             {
                 if (surfaceView.mWinFrame.width() != w || surfaceView.mWinFrame.height() != h)
                 {
                     surfaceView.mUpdateWindowNeeded = true;
                     surfaceView.mHandler.sendEmptyMessage(UPDATE_WINDOW_MSG);
                 }
             }
         }
         finally
         {
             surfaceView.mSurfaceLock.unlock();
         }
     }
 }
	  public override void onConfigurationChanged(Configuration newConfig)
	  {
		if (!EngagementAgentUtils.isInDedicatedEngagementProcess(this))
		{
		  onApplicationProcessConfigurationChanged(newConfig);
		}
	  }
Example #3
0
        /// <summary>Creates a new configuration for the specified context.</summary>
        /// <remarks>
        /// Creates a new configuration for the specified context. The configuration depends on
        /// various parameters of the context, like the dimension of the display or the density
        /// of the display.
        /// </remarks>
        /// <param name="context">The application context used to initialize this view configuration.
        ///     </param>
        /// <seealso cref="get(android.content.Context)"></seealso>
        /// <seealso cref="android.util.DisplayMetrics">android.util.DisplayMetrics</seealso>
        private ViewConfiguration(android.content.Context context)
        {
            android.content.res.Resources     res     = context.getResources();
            android.util.DisplayMetrics       metrics = res.getDisplayMetrics();
            android.content.res.Configuration config  = res.getConfiguration();
            float density = metrics.density;
            float sizeAndDensity;

            if (config.isLayoutSizeAtLeast(android.content.res.Configuration.SCREENLAYOUT_SIZE_XLARGE))
            {
                sizeAndDensity = density * 1.5f;
            }
            else
            {
                sizeAndDensity = density;
            }
            mEdgeSlop                      = (int)(sizeAndDensity * EDGE_SLOP + 0.5f);
            mFadingEdgeLength              = (int)(sizeAndDensity * FADING_EDGE_LENGTH + 0.5f);
            mMinimumFlingVelocity          = (int)(density * MINIMUM_FLING_VELOCITY + 0.5f);
            mMaximumFlingVelocity          = (int)(density * MAXIMUM_FLING_VELOCITY + 0.5f);
            mScrollbarSize                 = (int)(density * SCROLL_BAR_SIZE + 0.5f);
            mTouchSlop                     = (int)(sizeAndDensity * TOUCH_SLOP + 0.5f);
            mPagingTouchSlop               = (int)(sizeAndDensity * PAGING_TOUCH_SLOP + 0.5f);
            mDoubleTapSlop                 = (int)(sizeAndDensity * DOUBLE_TAP_SLOP + 0.5f);
            mScaledTouchExplorationTapSlop = (int)(density * TOUCH_EXPLORATION_TAP_SLOP + 0.5f
                                                   );
            mWindowTouchSlop = (int)(sizeAndDensity * WINDOW_TOUCH_SLOP + 0.5f);
            // Size of the screen in bytes, in ARGB_8888 format
            mMaximumDrawingCacheSize = 4 * metrics.widthPixels * metrics.heightPixels;
            mOverscrollDistance      = (int)(sizeAndDensity * OVERSCROLL_DISTANCE + 0.5f);
            mOverflingDistance       = (int)(sizeAndDensity * OVERFLING_DISTANCE + 0.5f);
            mFadingMarqueeEnabled    = false;
        }
Example #4
0
 public override void onConfigurationChanged(Configuration newConfig)
 {
     if (!EngagementAgentUtils.isInDedicatedEngagementProcess(this))
     {
         onApplicationProcessConfigurationChanged(newConfig);
     }
 }
 public abstract void bindApplication(string arg1, android.content.pm.ApplicationInfo
                                      arg2, java.util.List <android.content.pm.ProviderInfo> arg3, android.content.ComponentName
                                      arg4, string arg5, android.os.ParcelFileDescriptor arg6, bool arg7, android.os.Bundle
                                      arg8, android.app.IInstrumentationWatcher arg9, int arg10, bool arg11, bool arg12
                                      , android.content.res.Configuration arg13, android.content.res.CompatibilityInfo
                                      arg14, java.util.Map <string, android.os.IBinder> arg15, android.os.Bundle arg16
                                      );
Example #6
0
 protected internal override void onConfigurationChanged(android.content.res.Configuration
                                                         newConfig)
 {
     base.onConfigurationChanged(newConfig);
     mPresenter.updateMenuView(false);
     if (mPresenter != null && mPresenter.isOverflowMenuShowing())
     {
         mPresenter.hideOverflowMenu();
         mPresenter.showOverflowMenu();
     }
 }
Example #7
0
 public int compareTo(android.content.res.Configuration arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallIntMethod(this.JvmHandle, global::android.content.res.Configuration._compareTo2261, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
     else
     {
         return(@__env.CallNonVirtualIntMethod(this.JvmHandle, global::android.content.res.Configuration.staticClass, global::android.content.res.Configuration._compareTo2261, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
 }
 protected internal override void onConfigurationChanged(android.content.res.Configuration
                                                         newConfig)
 {
     base.onConfigurationChanged(newConfig);
     // Action bar can change size on configuration changes.
     // Reread the desired height from the theme-specified style.
     android.content.res.TypedArray a = getContext().obtainStyledAttributes(null, [email protected]
                                                                            .styleable.ActionBar, [email protected], 0);
     setContentHeight(a.getLayoutDimension([email protected]_height
                                           , 0));
     a.recycle();
 }
Example #9
0
 public virtual void onConfigurationChanged(android.content.res.Configuration arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.content.ContentProvider._onConfigurationChanged1135, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.content.ContentProvider.staticClass, global::android.content.ContentProvider._onConfigurationChanged1135, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Example #10
0
 public void setTo(android.content.res.Configuration arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.content.res.Configuration._setTo2265, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.content.res.Configuration.staticClass, global::android.content.res.Configuration._setTo2265, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Example #11
0
 public bool equals(android.content.res.Configuration arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallBooleanMethod(this.JvmHandle, global::android.content.res.Configuration._equals2257, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
     else
     {
         return(@__env.CallNonVirtualBooleanMethod(this.JvmHandle, global::android.content.res.Configuration.staticClass, global::android.content.res.Configuration._equals2257, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0)));
     }
 }
Example #12
0
 void android.content.ComponentCallbacks.onConfigurationChanged(android.content.res.Configuration arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.content.ComponentCallbacks_._onConfigurationChanged1104, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.content.ComponentCallbacks_.staticClass, global::android.content.ComponentCallbacks_._onConfigurationChanged1104, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Example #13
0
 public virtual void onConfigurationChanged(android.content.res.Configuration newConfig
                                            )
 {
     if (!mMaxItemsSet)
     {
         mMaxItems = mContext.getResources().getInteger([email protected]_action_buttons
                                                        );
         if (mMenu != null)
         {
             mMenu.onItemsChanged(true);
         }
     }
 }
Example #14
0
 public virtual void applyToConfiguration(android.content.res.Configuration inoutConfig
                                          )
 {
     if (!supportsScreen())
     {
         // This is a larger screen device and the app is not
         // compatible with large screens, so we are forcing it to
         // run as if the screen is normal size.
         inoutConfig.screenLayout = (inoutConfig.screenLayout & ~android.content.res.Configuration
                                     .SCREENLAYOUT_SIZE_MASK) | android.content.res.Configuration.SCREENLAYOUT_SIZE_NORMAL;
         inoutConfig.screenWidthDp         = inoutConfig.compatScreenWidthDp;
         inoutConfig.screenHeightDp        = inoutConfig.compatScreenHeightDp;
         inoutConfig.smallestScreenWidthDp = inoutConfig.compatSmallestScreenWidthDp;
     }
 }
Example #15
0
 public virtual void onConfigurationChanged(android.content.res.Configuration newConfig
                                            )
 {
     object[] callbacks = collectComponentCallbacks();
     if (callbacks != null)
     {
         {
             for (int i = 0; i < callbacks.Length; i++)
             {
                 ((android.content.ComponentCallbacks)callbacks[i]).onConfigurationChanged(newConfig
                                                                                           );
             }
         }
     }
 }
Example #16
0
 public virtual void reportNewConfiguration(android.content.res.Configuration config
                                            )
 {
     lock (this)
     {
         int count = mViews.Length;
         config = new android.content.res.Configuration(config);
         {
             for (int i = 0; i < count; i++)
             {
                 android.view.ViewRootImpl root = mRoots[i];
                 root.requestUpdateConfiguration(config);
             }
         }
     }
 }
Example #17
0
 protected internal override void onConfigurationChanged(android.content.res.Configuration
                                                         newConfig)
 {
     base.onConfigurationChanged(newConfig);
     // Action bar can change size on configuration changes.
     // Reread the desired height from the theme-specified style.
     android.content.res.TypedArray a = getContext().obtainStyledAttributes(null, [email protected]
                                                                            .styleable.ActionBar, [email protected], 0);
     setContentHeight(a.getLayoutDimension([email protected]_height
                                           , 0));
     a.recycle();
     if (mSplitWhenNarrow)
     {
         setSplitActionBar(getContext().getResources().getBoolean([email protected].@bool
                                                                  .split_action_bar_is_narrow));
     }
     if (mActionMenuPresenter != null)
     {
         mActionMenuPresenter.onConfigurationChanged(newConfig);
     }
 }
Example #18
0
 public override void onConfigurationChanged(android.content.res.Configuration newConfig)
 {
     throw new NotImplementedException();
 }
	  /// <summary>
	  /// Override this method instead of <seealso cref="#onConfigurationChanged(Configuration)"/> to avoid doing
	  /// unnecessary operations when the current process is the one dedicated to the Engagement service.
	  /// </summary>
	  protected internal virtual void onApplicationProcessConfigurationChanged(Configuration newConfig)
	  {
		/* Sub-class template method */
	  }
Example #20
0
 public virtual int relayout(android.view.IWindow window, int seq, android.view.WindowManagerClass
                             .LayoutParams attrs, int requestedWidth, int requestedHeight, int viewVisibility
                             , bool insetsPending, android.graphics.Rect outFrame, android.graphics.Rect outContentInsets
                             , android.graphics.Rect outVisibleInsets, android.content.res.Configuration outConfig
                             , android.view.Surface outSurface)
 {
     throw new System.NotImplementedException();
 }
Example #21
0
 protected internal override void onConfigurationChanged(android.content.res.Configuration
                                                         newConfig)
 {
     throw new System.NotImplementedException();
 }
Example #22
0
		internal android.content.res.Configuration applyCompatConfiguration()
		{
			android.content.res.Configuration config = mConfiguration;
			if (mCompatConfiguration == null)
			{
				mCompatConfiguration = new android.content.res.Configuration();
			}
			mCompatConfiguration.setTo(mConfiguration);
			if (mResCompatibilityInfo != null && !mResCompatibilityInfo.supportsScreen())
			{
				mResCompatibilityInfo.applyToConfiguration(mCompatConfiguration);
				config = mCompatConfiguration;
			}
			return config;
		}
Example #23
0
		internal void handleConfigurationChanged(android.content.res.Configuration config
			, android.content.res.CompatibilityInfo compat)
		{
			java.util.ArrayList<android.content.ComponentCallbacks2> callbacks = null;
			lock (mPackages)
			{
				if (mPendingConfiguration != null)
				{
					if (!mPendingConfiguration.isOtherSeqNewer(config))
					{
						config = mPendingConfiguration;
					}
					mPendingConfiguration = null;
				}
				if (config == null)
				{
					return;
				}
				applyConfigurationToResourcesLocked(config, compat);
				if (mConfiguration == null)
				{
					mConfiguration = new android.content.res.Configuration();
				}
				if (!mConfiguration.isOtherSeqNewer(config) && compat == null)
				{
					return;
				}
				mConfiguration.updateFrom(config);
				config = applyCompatConfiguration();
				callbacks = collectComponentCallbacksLocked(false, config);
			}
			// Cleanup hardware accelerated stuff
			android.view.WindowManagerImpl.getDefault().trimLocalMemory();
			if (callbacks != null)
			{
				int N = callbacks.size();
				{
					for (int i = 0; i < N; i++)
					{
						performConfigurationChanged(callbacks.get(i), config);
					}
				}
			}
		}
 public abstract void scheduleConfigurationChanged(android.content.res.Configuration
                                                   arg1);
Example #25
0
		internal bool applyConfigurationToResourcesLocked(android.content.res.Configuration
			 config, android.content.res.CompatibilityInfo compat)
		{
			if (mResConfiguration == null)
			{
				mResConfiguration = new android.content.res.Configuration();
			}
			if (!mResConfiguration.isOtherSeqNewer(config) && compat == null)
			{
				return false;
			}
			int changes = mResConfiguration.updateFrom(config);
			android.util.DisplayMetrics dm = getDisplayMetricsLocked(null, true);
			if (compat != null && (mResCompatibilityInfo == null || !mResCompatibilityInfo.Equals
				(compat)))
			{
				mResCompatibilityInfo = compat;
				changes |= android.content.pm.ActivityInfo.CONFIG_SCREEN_LAYOUT | android.content.pm.ActivityInfo
					.CONFIG_SCREEN_SIZE | android.content.pm.ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE;
			}
			// set it for java, this also affects newly created Resources
			if (config.locale != null)
			{
				Sharpen.Util.SetCurrentCulture(config.locale);
			}
			android.content.res.Resources.updateSystemConfiguration(config, dm, compat);
			android.app.ApplicationPackageManager.configurationChanged();
			//Slog.i(TAG, "Configuration changed in " + currentPackageName());
			java.util.Iterator<[email protected]<android.content.res.Resources>> it
				 = mActiveResources.values().iterator();
			//Iterator<Map.Entry<String, WeakReference<Resources>>> it =
			//    mActiveResources.entrySet().iterator();
			while (it.hasNext())
			{
				[email protected]<android.content.res.Resources> v = it.next();
				android.content.res.Resources r = v.get();
				if (r != null)
				{
					r.updateConfiguration(config, dm, compat);
				}
				else
				{
					//Slog.i(TAG, "Updated app resources " + v.getKey()
					//        + " " + r + ": " + r.getConfiguration());
					//Slog.i(TAG, "Removing old resources " + v.getKey());
					it.remove();
				}
			}
			return changes != 0;
		}
Example #26
0
		public virtual void reportNewConfiguration(android.content.res.Configuration config
			)
		{
			lock (this)
			{
				int count = mViews.Length;
				config = new android.content.res.Configuration(config);
				{
					for (int i = 0; i < count; i++)
					{
						android.view.ViewRootImpl root = mRoots[i];
						root.requestUpdateConfiguration(config);
					}
				}
			}
		}
Example #27
0
 public virtual void onConfigurationChanged(android.content.res.Configuration newConfig
                                            )
 {
     throw new System.NotImplementedException();
 }
 public virtual void scheduleLaunchActivity(android.content.Intent intent, android.os.IBinder
                                            token, int ident, android.content.pm.ActivityInfo info, android.content.res.Configuration
                                            curConfig, android.content.res.CompatibilityInfo compatInfo, android.os.Bundle
                                            state, java.util.List <android.app.ResultInfo> pendingResults, java.util.List <android.content.Intent
                                                                                                                           > pendingNewIntents, bool notResumed, bool isForward, string profileName, android.os.ParcelFileDescriptor
                                            profileFd, bool autoStopProfiler)
 {
     throw new System.NotImplementedException();
 }
 public virtual void scheduleRelaunchActivity(android.os.IBinder token, java.util.List
                                              <android.app.ResultInfo> pendingResults, java.util.List <android.content.Intent>
                                              pendingNewIntents, int configChanges, bool notResumed, android.content.res.Configuration
                                              config)
 {
     throw new System.NotImplementedException();
 }
Example #30
0
		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;
		}
Example #31
0
 public abstract int relayout(android.view.IWindow arg1, int arg2, android.view.WindowManagerClass
                              .LayoutParams arg3, int arg4, int arg5, int arg6, bool arg7, android.graphics.Rect
                              arg8, android.graphics.Rect arg9, android.graphics.Rect arg10, android.content.res.Configuration
                              arg11, android.view.Surface arg12);
Example #32
0
 public override void resized(int w, int h, android.graphics.Rect coveredInsets, android.graphics.Rect
                              visibleInsets, bool reportDraw, android.content.res.Configuration newConfig)
 {
     throw new System.NotImplementedException();
 }
 public abstract void scheduleRelaunchActivity(android.os.IBinder arg1, java.util.List
                                               <android.app.ResultInfo> arg2, java.util.List <android.content.Intent> arg3, int
                                               arg4, bool arg5, android.content.res.Configuration arg6);
 public abstract void scheduleLaunchActivity(android.content.Intent arg1, android.os.IBinder
                                             arg2, int arg3, android.content.pm.ActivityInfo arg4, android.content.res.Configuration
                                             arg5, android.content.res.CompatibilityInfo arg6, android.os.Bundle arg7, java.util.List
                                             <android.app.ResultInfo> arg8, java.util.List <android.content.Intent> arg9, bool
                                             arg10, bool arg11, string arg12, android.os.ParcelFileDescriptor arg13, bool arg14
                                             );
Example #35
0
 protected internal override void onConfigurationChanged(android.content.res.Configuration
                                                         newConfig)
 {
     base.onConfigurationChanged(newConfig);
     setCurrentLocale(newConfig.locale);
 }
Example #36
0
		internal static android.content.res.Configuration applyConfigCompat(android.content.res.Configuration
			 config, android.content.res.CompatibilityInfo compat)
		{
			if (config == null)
			{
				return null;
			}
			if (compat != null && !compat.supportsScreen())
			{
				config = new android.content.res.Configuration(config);
				compat.applyToConfiguration(config);
			}
			return config;
		}
Example #37
0
 /// <summary>
 /// Override this method instead of <seealso cref="#onConfigurationChanged(Configuration)"/> to avoid doing
 /// unnecessary operations when the current process is the one dedicated to the Engagement service.
 /// </summary>
 protected internal virtual void onApplicationProcessConfigurationChanged(Configuration newConfig)
 {
     /* Sub-class template method */
 }
Example #38
0
		internal android.app.Activity performLaunchActivity(android.app.ActivityThread.ActivityClientRecord
			 r, android.content.Intent customIntent)
		{
			// System.out.println("##### [" + System.currentTimeMillis() + "] ActivityThread.performLaunchActivity(" + r + ")");
			android.content.pm.ActivityInfo aInfo = r.activityInfo;
			if (r.packageInfo == null)
			{
				r.packageInfo = getPackageInfo(aInfo.applicationInfo, r.compatInfo, android.content.Context
					.CONTEXT_INCLUDE_CODE);
			}
			android.content.ComponentName component = r.intent.getComponent();
			if (component == null)
			{
				component = r.intent.resolveActivity(mInitialApplication.getPackageManager());
				r.intent.setComponent(component);
			}
			if (r.activityInfo.targetActivity != null)
			{
				component = new android.content.ComponentName(r.activityInfo.packageName, r.activityInfo
					.targetActivity);
			}
			android.app.Activity activity = null;
			try
			{
				java.lang.ClassLoader cl = r.packageInfo.getClassLoader();
				activity = mInstrumentation.newActivity(cl, component.getClassName(), r.intent);
				android.os.StrictMode.incrementExpectedActivityCount(activity.GetType());
				r.intent.setExtrasClassLoader(cl);
				if (r.state != null)
				{
					r.state.setClassLoader(cl);
				}
			}
			catch (System.Exception e)
			{
				if (!mInstrumentation.onException(activity, e))
				{
					throw new java.lang.RuntimeException("Unable to instantiate activity " + component
						 + ": " + e.ToString(), e);
				}
			}
			try
			{
				android.app.Application app = r.packageInfo.makeApplication(false, mInstrumentation
					);
				if (activity != null)
				{
					android.app.ContextImpl appContext = new android.app.ContextImpl();
					appContext.init(r.packageInfo, r.token, this);
					appContext.setOuterContext(activity);
					java.lang.CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager
						());
					android.content.res.Configuration config = new android.content.res.Configuration(
						mCompatConfiguration);
					activity.attach(appContext, this, getInstrumentation(), r.token, r.ident, app, r.
						intent, r.activityInfo, title, r.parent, r.embeddedID, r.lastNonConfigurationInstances
						, config);
					if (customIntent != null)
					{
						activity.mIntent = customIntent;
					}
					r.lastNonConfigurationInstances = null;
					activity.mStartedActivity = false;
					int theme = r.activityInfo.getThemeResource();
					if (theme != 0)
					{
						activity.setTheme(theme);
					}
					activity.mCalled = false;
					mInstrumentation.callActivityOnCreate(activity, r.state);
					if (!activity.mCalled)
					{
						throw new android.app.SuperNotCalledException("Activity " + r.intent.getComponent
							().toShortString() + " did not call through to super.onCreate()");
					}
					r.activity = activity;
					r.stopped = true;
					if (!r.activity.mFinished)
					{
						activity.performStart();
						r.stopped = false;
					}
					if (!r.activity.mFinished)
					{
						if (r.state != null)
						{
							mInstrumentation.callActivityOnRestoreInstanceState(activity, r.state);
						}
					}
					if (!r.activity.mFinished)
					{
						activity.mCalled = false;
						mInstrumentation.callActivityOnPostCreate(activity, r.state);
						if (!activity.mCalled)
						{
							throw new android.app.SuperNotCalledException("Activity " + r.intent.getComponent
								().toShortString() + " did not call through to super.onPostCreate()");
						}
					}
				}
				r.paused = true;
				mActivities.put(r.token, r);
			}
			catch (android.app.SuperNotCalledException e)
			{
				throw;
			}
			catch (System.Exception e)
			{
				if (!mInstrumentation.onException(activity, e))
				{
					throw new java.lang.RuntimeException("Unable to start activity " + component + ": "
						 + e.ToString(), e);
				}
			}
			return activity;
		}
Example #39
0
		internal void handleRelaunchActivity(android.app.ActivityThread.ActivityClientRecord
			 tmp)
		{
			// If we are getting ready to gc after going to the background, well
			// we are back active so skip it.
			unscheduleGcIdler();
			android.content.res.Configuration changedConfig = null;
			int configChanges = 0;
			// First: make sure we have the most recent configuration and most
			// recent version of the activity, or skip it if some previous call
			// had taken a more recent version.
			lock (mPackages)
			{
				int N = mRelaunchingActivities.size();
				android.os.IBinder token = tmp.token;
				tmp = null;
				{
					for (int i = 0; i < N; i++)
					{
						android.app.ActivityThread.ActivityClientRecord r = mRelaunchingActivities.get(i);
						if (r.token == token)
						{
							tmp = r;
							configChanges |= tmp.pendingConfigChanges;
							mRelaunchingActivities.remove(i);
							i--;
							N--;
						}
					}
				}
				if (tmp == null)
				{
					return;
				}
				if (mPendingConfiguration != null)
				{
					changedConfig = mPendingConfiguration;
					mPendingConfiguration = null;
				}
			}
			if (tmp.createdConfig != null)
			{
				// If the activity manager is passing us its current config,
				// assume that is really what we want regardless of what we
				// may have pending.
				if (mConfiguration == null || (tmp.createdConfig.isOtherSeqNewer(mConfiguration) 
					&& mConfiguration.diff(tmp.createdConfig) != 0))
				{
					if (changedConfig == null || tmp.createdConfig.isOtherSeqNewer(changedConfig))
					{
						changedConfig = tmp.createdConfig;
					}
				}
			}
			// If there was a pending configuration change, execute it first.
			if (changedConfig != null)
			{
				handleConfigurationChanged(changedConfig, null);
			}
			android.app.ActivityThread.ActivityClientRecord r_1 = mActivities.get(tmp.token);
			if (r_1 == null)
			{
				return;
			}
			r_1.activity.mConfigChangeFlags |= configChanges;
			r_1.onlyLocalRequest = tmp.onlyLocalRequest;
			android.content.Intent currentIntent = r_1.activity.mIntent;
			r_1.activity.mChangingConfigurations = true;
			// Need to ensure state is saved.
			if (!r_1.paused)
			{
				performPauseActivity(r_1.token, false, r_1.isPreHoneycomb());
			}
			if (r_1.state == null && !r_1.stopped && !r_1.isPreHoneycomb())
			{
				r_1.state = new android.os.Bundle();
				r_1.state.setAllowFds(false);
				mInstrumentation.callActivityOnSaveInstanceState(r_1.activity, r_1.state);
			}
			handleDestroyActivity(r_1.token, false, configChanges, true);
			r_1.activity = null;
			r_1.window = null;
			r_1.hideForNow = false;
			r_1.nextIdle = null;
			// Merge any pending results and pending intents; don't just replace them
			if (tmp.pendingResults != null)
			{
				if (r_1.pendingResults == null)
				{
					r_1.pendingResults = tmp.pendingResults;
				}
				else
				{
					r_1.pendingResults.addAll(tmp.pendingResults);
				}
			}
			if (tmp.pendingIntents != null)
			{
				if (r_1.pendingIntents == null)
				{
					r_1.pendingIntents = tmp.pendingIntents;
				}
				else
				{
					r_1.pendingIntents.addAll(tmp.pendingIntents);
				}
			}
			r_1.startsNotResumed = tmp.startsNotResumed;
			handleLaunchActivity(r_1, currentIntent);
		}
 public virtual void bindApplication(string packageName, android.content.pm.ApplicationInfo
                                     info, java.util.List <android.content.pm.ProviderInfo> providers, android.content.ComponentName
                                     testName, string profileName, android.os.ParcelFileDescriptor profileFd, bool autoStopProfiler
                                     , android.os.Bundle testArgs, android.app.IInstrumentationWatcher testWatcher, int
                                     debugMode, bool restrictedBackupMode, bool persistent, android.content.res.Configuration
                                     config, android.content.res.CompatibilityInfo compatInfo, java.util.Map <string,
                                                                                                              android.os.IBinder> services, android.os.Bundle coreSettings)
 {
     throw new System.NotImplementedException();
 }