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


Java RemoteCallbackList类代码示例

本文整理汇总了Java中android.os.RemoteCallbackList的典型用法代码示例。如果您正苦于以下问题:Java RemoteCallbackList类的具体用法?Java RemoteCallbackList怎么用?Java RemoteCallbackList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: PlayControlImpl

import android.os.RemoteCallbackList; //导入依赖的package包/类
public PlayControlImpl(Context context) {
    this.context = context;
    this.mSongChangeListeners = new RemoteCallbackList<>();
    this.mStatusChangeListeners = new RemoteCallbackList<>();
    this.mPlayListChangeListeners = new RemoteCallbackList<>();
    this.mDataIsReadyListeners = new RemoteCallbackList<>();

    this.sessionManager = new MediaSessionManager(context, this);
    this.focusManager = new AudioFocusManager(context, this);
    this.manager = PlayController.getMediaController(
            context,
            focusManager,
            sessionManager,
            new NotifyStatusChange(),
            new NotifySongChange(),
            new NotifyPlayListChange());
}
 
开发者ID:DuanJiaNing,项目名称:Musicoco,代码行数:18,代码来源:PlayControlImpl.java

示例2: ImConnectionAdapter

import android.os.RemoteCallbackList; //导入依赖的package包/类
public ImConnectionAdapter(long providerId, long accountId, ImConnection connection, RemoteImService service) {
    mProviderId = providerId;
    mAccountId = accountId;
    mConnection = connection;
    mService = service;
    mConnectionListener = new ConnectionListenerAdapter();
    mConnection.addConnectionListener(mConnectionListener);
    if ((connection.getCapability() & ImConnection.CAPABILITY_GROUP_CHAT) != 0) {
        mGroupManager = mConnection.getChatGroupManager();
        mInvitationListener = new InvitationListenerAdapter();
        mGroupManager.setInvitationListener(mInvitationListener);
    }

    mChatSessionManager = new ChatSessionManagerAdapter(this);
    mContactListManager = new ContactListManagerAdapter(this);
    mRemoteConnListeners = new RemoteCallbackList<>();

}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:19,代码来源:ImConnectionAdapter.java

示例3: handleMessage

import android.os.RemoteCallbackList; //导入依赖的package包/类
@Override public void handleMessage(Message msg) {

			RemoteCallbackList<IOpenVPNStatusCallback> callbacks;
			switch (msg.what) {
			case SEND_TOALL:
				if(service ==null || service.get() == null)
					return;

				callbacks = service.get().mCallbacks;


				// Broadcast to all clients the new value.
				final int N = callbacks.beginBroadcast();
				for (int i=0; i<N; i++) {
					try {
						sendUpdate(callbacks.getBroadcastItem(i),(UpdateMessage) msg.obj);
					} catch (RemoteException e) {
						// The RemoteCallbackList will take care of removing
						// the dead object for us.
					}
				}
				callbacks.finishBroadcast();
				break;
			}
		}
 
开发者ID:cernekee,项目名称:ics-openconnect,代码行数:26,代码来源:ExternalOpenVPNService.java

示例4: onCreate

import android.os.RemoteCallbackList; //导入依赖的package包/类
@Override
public void onCreate() {
  // TODO: make this multi-threaded... someday.
  mScheduledExecutor = Executors.newScheduledThreadPool(1);

  // Start a periodic garbage collection task to check for and cleanup any
  // terminated delay sockets.
  mScheduledExecutor.scheduleAtFixedRate(new Runnable() {
    @Override
    public void run() {
      for (Long handle : mDelaySockets.keySet()) {
        DelaySocket delaySocket = mDelaySockets.get(handle);
        if (delaySocket != null && delaySocket.isTerminated()) {
          delaySocket.close();
          mDelaySockets.remove(handle);
        }
      }
    }
  }, 0, 4000, TimeUnit.MILLISECONDS);

  mCallbacks = new RemoteCallbackList<INetworkServiceCallback>();
  mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  mDelaySockets = new ConcurrentHashMap<Long, DelaySocket>();
  showNotification();
}
 
开发者ID:alexjlockwood,项目名称:network-buffer,代码行数:26,代码来源:NetworkService.java

示例5: testBasicWiring

import android.os.RemoteCallbackList; //导入依赖的package包/类
@Test
public void testBasicWiring() throws Exception {
  RemoteCallbackList<Foo> fooRemoteCallbackList = new RemoteCallbackList<Foo>();
  Foo callback = new Foo();
  fooRemoteCallbackList.register(callback);

  fooRemoteCallbackList.beginBroadcast();

  assertThat(fooRemoteCallbackList.getBroadcastItem(0)).isSameAs(callback);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:11,代码来源:RemoteCallbackListTest.java

示例6: onCreate

import android.os.RemoteCallbackList; //导入依赖的package包/类
@Override
public void onCreate() {
	super.onCreate();

	try {
		listeners = new RemoteCallbackList<IFeedRetrieverServiceCallback>();
		NotiziePoliticheApplication app = (NotiziePoliticheApplication) getApplication();
		app.firstTimeInitApplication();

		Intent i = new Intent(getApplicationContext(),
				RefreshAllReceiver.class);
		intentRefreshAll = PendingIntent.getBroadcast(
				getApplicationContext(), 0, i,
				PendingIntent.FLAG_UPDATE_CURRENT);

		i = new Intent(getApplicationContext(),
				RemoveExpiredDataReceiver.class);
		intentExpiredData = PendingIntent.getBroadcast(
				getApplicationContext(), 0, i,
				PendingIntent.FLAG_UPDATE_CURRENT);

		configureServiceParameters();

	} catch (Exception e) {
		Log.e(getClass().getName(), "Creating the feeds service", e);
		throw new RuntimeException(e);
	}
}
 
开发者ID:tizfa,项目名称:NotiziePolitiche,代码行数:29,代码来源:FeedRetrieverService.java

示例7: ConnectionEvent

import android.os.RemoteCallbackList; //导入依赖的package包/类
public ConnectionEvent(RemoteCallbackList<ConnectionCallBack> mCallbackList) {
    this.mCallbackList = mCallbackList;
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:4,代码来源:ConnectionEvent.java


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