當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。