本文整理汇总了C#中android.asBinder方法的典型用法代码示例。如果您正苦于以下问题:C# android.asBinder方法的具体用法?C# android.asBinder怎么用?C# android.asBinder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android
的用法示例。
在下文中一共展示了android.asBinder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: startListening
public virtual int[] startListening([email protected] host
, string packageName, int hostId, java.util.List<android.widget.RemoteViews> updatedViews
)
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int[] _result;
try
{
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((host != null)) ? (host.asBinder()) : (null)));
_data.writeString(packageName);
_data.writeInt(hostId);
mRemote.transact([email protected]ION_startListening
, _data, _reply, 0);
_reply.readException();
_result = _reply.createIntArray();
_reply.readTypedList(updatedViews, android.widget.RemoteViews.CREATOR);
}
finally
{
_reply.recycle();
_data.recycle();
}
return _result;
}
示例2: unregisterCallback
public virtual void unregisterCallback([email protected]
cb)
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try
{
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((cb != null)) ? (cb.asBinder()) : (null)));
mRemote.transact([email protected]N_unregisterCallback
, _data, _reply, 0);
_reply.readException();
}
finally
{
_reply.recycle();
_data.recycle();
}
}
示例3: removeDeadProvider
internal void removeDeadProvider(string name, android.content.IContentProvider provider
)
{
lock (mProviderMap)
{
android.app.ActivityThread.ProviderClientRecord pr = mProviderMap.get(name);
if (pr != null && pr.mProvider.asBinder() == provider.asBinder())
{
android.util.Slog.i(TAG, "Removing dead content provider: " + name);
android.app.ActivityThread.ProviderClientRecord removed = mProviderMap.remove(name
);
if (removed != null)
{
removed.mProvider.asBinder().unlinkToDeath(removed, 0);
}
}
}
}
示例4: removeProviderLocked
//do nothing content provider object is dead any way
//end catch
public string removeProviderLocked(android.content.IContentProvider provider)
{
if (provider == null)
{
return null;
}
android.os.IBinder providerBinder = provider.asBinder();
string name = null;
// remove the provider from mProviderMap
java.util.Iterator<android.app.ActivityThread.ProviderClientRecord> iter = mProviderMap
.values().iterator();
while (iter.hasNext())
{
android.app.ActivityThread.ProviderClientRecord pr = iter.next();
android.os.IBinder myBinder = pr.mProvider.asBinder();
if (myBinder == providerBinder)
{
//find if its published by this process itself
if (pr.mLocalProvider != null)
{
return name;
}
//content provider is in another process
myBinder.unlinkToDeath(pr, 0);
iter.remove();
//invoke remove only once for the very first name seen
if (name == null)
{
name = pr.mName;
}
}
}
//end if myBinder
//end while iter
return name;
}
示例5: completeRemoveProvider
internal void completeRemoveProvider(android.content.IContentProvider provider)
{
android.os.IBinder jBinder = provider.asBinder();
string name = null;
lock (mProviderMap)
{
android.app.ActivityThread.ProviderRefCount prc = mProviderRefCountMap.get(jBinder
);
if (prc != null && prc.count == 0)
{
mProviderRefCountMap.remove(jBinder);
//invoke removeProvider to dereference provider
name = removeProviderLocked(provider);
}
}
if (name != null)
{
try
{
android.app.ActivityManagerNative.getDefault().removeContentProvider(getApplicationThread
(), name);
}
catch (android.os.RemoteException)
{
}
}
}
示例6: releaseProvider
public bool releaseProvider(android.content.IContentProvider provider)
{
if (provider == null)
{
return false;
}
android.os.IBinder jBinder = provider.asBinder();
lock (mProviderMap)
{
android.app.ActivityThread.ProviderRefCount prc = mProviderRefCountMap.get(jBinder
);
if (prc == null)
{
return false;
}
else
{
prc.count--;
if (prc.count == 0)
{
// Schedule the actual remove asynchronously, since we
// don't know the context this will be called in.
// TODO: it would be nice to post a delayed message, so
// if we come back and need the same provider quickly
// we will still have it available.
android.os.Message msg = mH.obtainMessage(android.app.ActivityThread.H.REMOVE_PROVIDER
, provider);
mH.sendMessage(msg);
}
}
}
//end if
//end else
//end synchronized
return true;
}
示例7: registerStatusBar
public virtual void registerStatusBar([email protected] callbacks
, [email protected] iconList, java.util.List<android.os.IBinder
> notificationKeys, java.util.List<[email protected]
> notifications, int[] switches, java.util.List<android.os.IBinder> binders)
{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try
{
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStrongBinder((((callbacks != null)) ? (callbacks.asBinder()) : (null))
);
if ((switches == null))
{
_data.writeInt(-1);
}
else
{
_data.writeInt(switches.Length);
}
mRemote.transact([email protected]ION_registerStatusBar
, _data, _reply, 0);
_reply.readException();
if ((0 != _reply.readInt()))
{
iconList.readFromParcel(_reply);
}
_reply.readBinderList(notificationKeys);
_reply.readTypedList(notifications, [email protected]
.CREATOR);
_reply.readIntArray(switches);
_reply.readBinderList(binders);
}
finally
{
_reply.recycle();
_data.recycle();
}
}