本文整理汇总了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;
}
示例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"
);
}
示例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"
);
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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)
{
}
}
示例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)
{
}
}