当前位置: 首页>>代码示例>>C#>>正文


C# android.setAllowFds方法代码示例

本文整理汇总了C#中android.setAllowFds方法的典型用法代码示例。如果您正苦于以下问题:C# android.setAllowFds方法的具体用法?C# android.setAllowFds怎么用?C# android.setAllowFds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android的用法示例。


在下文中一共展示了android.setAllowFds方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createPendingResult

		public virtual android.app.PendingIntent createPendingResult(int requestCode, android.content.Intent
			 data, int flags)
		{
			string packageName = getPackageName();
			try
			{
				data.setAllowFds(false);
				android.content.IIntentSender target = android.app.ActivityManagerNative.getDefault
					().getIntentSender(android.app.IActivityManagerClass.INTENT_SENDER_ACTIVITY_RESULT
					, packageName, mParent == null ? mToken : mParent.mToken, mEmbeddedID, requestCode
					, new android.content.Intent[] { data }, null, flags);
				return target != null ? new android.app.PendingIntent(target) : null;
			}
			catch (android.os.RemoteException)
			{
			}
			return null;
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:18,代码来源:Activity.cs

示例2: startActivityIfNeeded

		public virtual bool startActivityIfNeeded(android.content.Intent intent, int requestCode
			)
		{
			if (mParent == null)
			{
				int result = android.app.IActivityManagerClass.START_RETURN_INTENT_TO_CALLER;
				try
				{
					intent.setAllowFds(false);
					result = android.app.ActivityManagerNative.getDefault().startActivity(mMainThread
						.getApplicationThread(), intent, intent.resolveTypeIfNeeded(getContentResolver()
						), null, 0, mToken, mEmbeddedID, requestCode, true, false, null, null, false);
				}
				catch (android.os.RemoteException)
				{
				}
				android.app.Instrumentation.checkStartActivityResult(result, intent);
				if (requestCode >= 0)
				{
					mStartedActivity = true;
				}
				return result != android.app.IActivityManagerClass.START_RETURN_INTENT_TO_CALLER;
			}
			throw new System.NotSupportedException("startActivityIfNeeded can only be called from a top-level activity"
				);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:26,代码来源:Activity.cs

示例3: startNextMatchingActivity

		public virtual bool startNextMatchingActivity(android.content.Intent intent)
		{
			if (mParent == null)
			{
				try
				{
					intent.setAllowFds(false);
					return android.app.ActivityManagerNative.getDefault().startNextMatchingActivity(mToken
						, intent);
				}
				catch (android.os.RemoteException)
				{
				}
				return false;
			}
			throw new System.NotSupportedException("startNextMatchingActivity can only be called from a top-level activity"
				);
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:18,代码来源:Activity.cs

示例4: startInstrumentation

		public override bool startInstrumentation(android.content.ComponentName className
			, string profileFile, android.os.Bundle arguments)
		{
			try
			{
				if (arguments != null)
				{
					arguments.setAllowFds(false);
				}
				return android.app.ActivityManagerNative.getDefault().startInstrumentation(className
					, profileFile, 0, arguments, null);
			}
			catch (android.os.RemoteException)
			{
			}
			// System has crashed, nothing we can do.
			return false;
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:18,代码来源:ContextImpl.cs

示例5: startIntentSenderForResultInner

		private void startIntentSenderForResultInner(android.content.IntentSender intent, 
			int requestCode, android.content.Intent fillInIntent, int flagsMask, int flagsValues
			, android.app.Activity activity)
		{
			try
			{
				string resolvedType = null;
				if (fillInIntent != null)
				{
					fillInIntent.setAllowFds(false);
					resolvedType = fillInIntent.resolveTypeIfNeeded(getContentResolver());
				}
				int result = android.app.ActivityManagerNative.getDefault().startActivityIntentSender
					(mMainThread.getApplicationThread(), intent, fillInIntent, resolvedType, mToken, 
					activity.mEmbeddedID, requestCode, flagsMask, flagsValues);
				if (result == android.app.IActivityManagerClass.START_CANCELED)
				{
					throw new android.content.IntentSender.SendIntentException();
				}
				android.app.Instrumentation.checkStartActivityResult(result, null);
			}
			catch (android.os.RemoteException)
			{
			}
			if (requestCode >= 0)
			{
				mStartedActivity = true;
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:29,代码来源:Activity.cs

示例6: bindService

		public override bool bindService(android.content.Intent service, android.content.ServiceConnection
			 conn, int flags)
		{
			android.app.IServiceConnection sd;
			if (mPackageInfo != null)
			{
				sd = mPackageInfo.getServiceDispatcher(conn, getOuterContext(), mMainThread.getHandler
					(), flags);
			}
			else
			{
				throw new java.lang.RuntimeException("Not supported in system context");
			}
			try
			{
				android.os.IBinder token = getActivityToken();
				if (token == null && (flags & BIND_AUTO_CREATE) == 0 && mPackageInfo != null && mPackageInfo
					.getApplicationInfo().targetSdkVersion < android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH)
				{
					flags |= BIND_WAIVE_PRIORITY;
				}
				service.setAllowFds(false);
				int res = android.app.ActivityManagerNative.getDefault().bindService(mMainThread.
					getApplicationThread(), getActivityToken(), service, service.resolveTypeIfNeeded
					(getContentResolver()), sd, flags);
				if (res < 0)
				{
					throw new System.Security.SecurityException("Not allowed to bind to service " + service
						);
				}
				return res != 0;
			}
			catch (android.os.RemoteException)
			{
				return false;
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:37,代码来源:ContextImpl.cs

示例7: stopService

		public override bool stopService(android.content.Intent service)
		{
			try
			{
				service.setAllowFds(false);
				int res = android.app.ActivityManagerNative.getDefault().stopService(mMainThread.
					getApplicationThread(), service, service.resolveTypeIfNeeded(getContentResolver(
					)));
				if (res < 0)
				{
					throw new System.Security.SecurityException("Not allowed to stop service " + service
						);
				}
				return res != 0;
			}
			catch (android.os.RemoteException)
			{
				return false;
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:20,代码来源:ContextImpl.cs

示例8: startService

		public override android.content.ComponentName startService(android.content.Intent
			 service)
		{
			try
			{
				service.setAllowFds(false);
				android.content.ComponentName cn = android.app.ActivityManagerNative.getDefault()
					.startService(mMainThread.getApplicationThread(), service, service.resolveTypeIfNeeded
					(getContentResolver()));
				if (cn != null && cn.getPackageName().Equals("!"))
				{
					throw new System.Security.SecurityException("Not allowed to start service " + service
						 + " without permission " + cn.getClassName());
				}
				return cn;
			}
			catch (android.os.RemoteException)
			{
				return null;
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:21,代码来源:ContextImpl.cs

示例9: sendStickyBroadcast

		public override void sendStickyBroadcast(android.content.Intent intent)
		{
			string resolvedType = intent.resolveTypeIfNeeded(getContentResolver());
			try
			{
				intent.setAllowFds(false);
				android.app.ActivityManagerNative.getDefault().broadcastIntent(mMainThread.getApplicationThread
					(), intent, resolvedType, null, android.app.Activity.RESULT_OK, null, null, null
					, false, true);
			}
			catch (android.os.RemoteException)
			{
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:14,代码来源:ContextImpl.cs

示例10: startIntentSender

		public override void startIntentSender(android.content.IntentSender intent, android.content.Intent
			 fillInIntent, int flagsMask, int flagsValues, int extraFlags)
		{
			try
			{
				string resolvedType = null;
				if (fillInIntent != null)
				{
					fillInIntent.setAllowFds(false);
					resolvedType = fillInIntent.resolveTypeIfNeeded(getContentResolver());
				}
				int result = android.app.ActivityManagerNative.getDefault().startActivityIntentSender
					(mMainThread.getApplicationThread(), intent, fillInIntent, resolvedType, null, null
					, 0, flagsMask, flagsValues);
				if (result == android.app.IActivityManagerClass.START_CANCELED)
				{
					throw new android.content.IntentSender.SendIntentException();
				}
				android.app.Instrumentation.checkStartActivityResult(result, null);
			}
			catch (android.os.RemoteException)
			{
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:24,代码来源:ContextImpl.cs


注:本文中的android.setAllowFds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。