當前位置: 首頁>>代碼示例>>Java>>正文


Java Parcel.readStrongBinder方法代碼示例

本文整理匯總了Java中android.os.Parcel.readStrongBinder方法的典型用法代碼示例。如果您正苦於以下問題:Java Parcel.readStrongBinder方法的具體用法?Java Parcel.readStrongBinder怎麽用?Java Parcel.readStrongBinder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.os.Parcel的用法示例。


在下文中一共展示了Parcel.readStrongBinder方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onTransact

import android.os.Parcel; //導入方法依賴的package包/類
@Override
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
    try {
        switch (code) {
            case INTERFACE_TRANSACTION: {
                reply.writeString(DESCRIPTOR);
                return true;
            }
            case TRANSACTION_subscribe_0: {
                data.enforceInterface(DESCRIPTOR);
                RemoteEventListener arg_stb_0;
                arg_stb_0 = new RemoteEventListener_Proxy(data.readStrongBinder());
                serviceImpl.subscribe(arg_stb_0);
                return true;
            }
            case TRANSACTION_unsubscribe_1: {
                data.enforceInterface(DESCRIPTOR);
                serviceImpl.unsubscribe();
                return true;
            }
        }
    } catch (Exception re) {
    }
    return super.onTransact(code, data, reply, flags);
}
 
開發者ID:josesamuel,項目名稱:RxRemote,代碼行數:26,代碼來源:RemoteEventManager_Stub.java

示例2: findService

import android.os.Parcel; //導入方法依賴的package包/類
private IBinder findService(String name){
	Parcel data = Parcel.obtain();
	data.writeString(name);
	Parcel reply = Parcel.obtain();
	try {
		mRemoteServiceManager.transact(ServiceContext.GET_SERVICE, data, reply, 0);
		IBinder service = reply.readStrongBinder();
		log("getService result binder = " + service);
		return service;
	} catch (RemoteException e) {
		e.printStackTrace();
		log("getService exception");
		return null;
	} finally {
		data.recycle();
		reply.recycle();
	}
}
 
開發者ID:devyok,項目名稱:DroidIPC,代碼行數:19,代碼來源:ServiceManagerImpl.java

示例3: createFromParcel

import android.os.Parcel; //導入方法依賴的package包/類
public Token createFromParcel(Parcel in) {
    Object readParcelable;
    if (VERSION.SDK_INT >= 21) {
        readParcelable = in.readParcelable(null);
    } else {
        readParcelable = in.readStrongBinder();
    }
    return new Token(readParcelable);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:10,代碼來源:MediaSessionCompat.java

示例4: PendingResultData

import android.os.Parcel; //導入方法依賴的package包/類
protected PendingResultData(Parcel in) {
    this.mType = in.readInt();
    this.mOrderedHint = in.readByte() != 0;
    this.mInitialStickyHint = in.readByte() != 0;
    this.mToken = in.readStrongBinder();
    this.mSendingUser = in.readInt();
    this.mFlags = in.readInt();
    this.mResultCode = in.readInt();
    this.mResultData = in.readString();
    this.mResultExtras = in.readBundle();
    this.mAbortBroadcast = in.readByte() != 0;
    this.mFinished = in.readByte() != 0;
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:14,代碼來源:PendingResultData.java

示例5: GcmIntentParser

import android.os.Parcel; //導入方法依賴的package包/類
/**
 * Iterates over the map looking for the {@link #BUNDLE_KEY_CALLBACK} key to try and read the {@link IBinder}
 * straight from the parcelled data. This is entirely dependent on the implementation of Parcel, but these specific
 * parts of {@link Parcel} / {@link Bundle} haven't changed since 2008 and newer versions of Android will ship
 * with newer versions of Google Play services which embed the IBinder directly into the {@link Bundle}
 * (no need to deal with the {@link android.os.Parcelable} issues).
 */
GcmIntentParser(Bundle data) throws RuntimeException {
    if (data == null) {
        throw new IllegalArgumentException();
    }

    jobId = Integer.valueOf(data.getString(BUNDLE_KEY_TAG));

    extras = data.getBundle(BUNDLE_KEY_EXTRAS);

    triggeredContentUris = data.getParcelableArrayList(BUNDLE_KEY_TRIGGERED_URIS);

    if (triggeredContentUris != null) {
        triggeredContentAuthorities = new ArrayList<>();
        for (Uri triggeredContentUri : triggeredContentUris) {
            triggeredContentAuthorities.add(triggeredContentUri.getAuthority());
        }
    }

    Parcel parcel = toParcel(data);
    try {
        int numEntries = checkNonEmptyBundleHeader(parcel);
        for (int i = 0; i < numEntries; i++) {
            String key = null;
            if (shouldReadKeysAsStrings()) {
                key = parcel.readString();
            } else {
                Object entryKeyObj = parcel.readValue(getClass().getClassLoader());
                if (entryKeyObj instanceof String) {
                    key = (String) entryKeyObj;
                }
            }

            if (key == null) {
                continue;
            }

            if (BUNDLE_KEY_CALLBACK.equals(key)
                    && parcel.readInt() == VAL_PARCELABLE
                    && PENDING_CALLBACK_CLASS.equals(parcel.readString())) {
                callback = parcel.readStrongBinder();
                break;
            }
        }
    } finally {
        parcel.recycle();
    }

    if (extras == null || callback == null) {
        throw new IllegalArgumentException();
    }
}
 
開發者ID:Doist,項目名稱:JobSchedulerCompat,代碼行數:59,代碼來源:GcmIntentParser.java

示例6: ContentProviderHolder

import android.os.Parcel; //導入方法依賴的package包/類
protected ContentProviderHolder(Parcel in) {
    info = in.readParcelable(ProviderInfo.class.getClassLoader());
    connection = in.readStrongBinder();
}
 
開發者ID:alibaba,項目名稱:atlas,代碼行數:5,代碼來源:ContentProviderHolder.java

示例7: ParcelBinder

import android.os.Parcel; //導入方法依賴的package包/類
private ParcelBinder(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
開發者ID:wangyupeng1-iri,項目名稱:springreplugin,代碼行數:4,代碼來源:ParcelBinder.java

示例8: BinderParcelable

import android.os.Parcel; //導入方法依賴的package包/類
BinderParcelable(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
開發者ID:wangyupeng1-iri,項目名稱:springreplugin,代碼行數:4,代碼來源:BinderCursor.java

示例9: BinderParcel

import android.os.Parcel; //導入方法依賴的package包/類
private BinderParcel(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
開發者ID:devyok,項目名稱:IPCServiceManager,代碼行數:4,代碼來源:BinderParcel.java

示例10: onTransact

import android.os.Parcel; //導入方法依賴的package包/類
@Override
protected boolean onTransact(int code, Parcel data, Parcel reply,
		int flags) throws RemoteException {
	
	
	if(code == ServiceContext.SERVER_READY) {
		
		IBinder remoteServiceManager = data.readStrongBinder();
		
		final ServiceManagerImpl clientServiceManager = ServiceManagerImpl.createLocalServiceManager(sClientContext, remoteServiceManager);
		
		Log.i("ServiceInitializeNotifier", "[Bundle Trasanct] "+getLocalSerivceManagerPackage()+" CommandCallback ok ");
		
		CoreThread.getHandler().post(new Runnable() {
			
			@Override
			public void run() {
				
				notifyAllListeners(clientServiceManager);
				
			}
		});
		
		reply.writeInt(ServiceContext.SUCCESS);
		
		sServerInitTime = (System.currentTimeMillis() - startTime);
		
	}
	
	return true;
}
 
開發者ID:devyok,項目名稱:DroidIPC,代碼行數:32,代碼來源:ServiceManagerImpl.java


注:本文中的android.os.Parcel.readStrongBinder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。