コード例 #1
0
ファイル: IAppWidgetService.cs プロジェクト: hakeemsm/XobotOS
				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(android.appwidget.@internal.IAppWidgetServiceClass.Stub.TRANSACTION_startListening
							, _data, _reply, 0);
						_reply.readException();
						_result = _reply.createIntArray();
						_reply.readTypedList(updatedViews, android.widget.RemoteViews.CREATOR);
					}
					finally
					{
						_reply.recycle();
						_data.recycle();
					}
					return _result;
				}
コード例 #2
0
				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(android.policy.@internal.IFaceLockInterfaceClass.Stub.TRANSACTION_unregisterCallback
							, _data, _reply, 0);
						_reply.readException();
					}
					finally
					{
						_reply.recycle();
						_data.recycle();
					}
				}
コード例 #3
0
ファイル: ActivityThread.cs プロジェクト: hakeemsm/XobotOS
		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
0
ファイル: ActivityThread.cs プロジェクト: hakeemsm/XobotOS
		//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
0
ファイル: ActivityThread.cs プロジェクト: hakeemsm/XobotOS
		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
0
ファイル: ActivityThread.cs プロジェクト: hakeemsm/XobotOS
		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
0
ファイル: IStatusBarService.cs プロジェクト: hakeemsm/XobotOS
				public virtual void registerStatusBar([email protected] callbacks
					, [email protected] iconList, java.util.List<android.os.IBinder
					> notificationKeys, java.util.List<*****@*****.**
					> 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(android.statusbar.@internal.IStatusBarServiceClass.Stub.TRANSACTION_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();
					}
				}