Java Code Examples for android.os.Parcel.readStrongBinder()

The following are Jave code examples for showing how to use readStrongBinder() of the android.os.Parcel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: RxRemote   File: RemoteEventManager_Stub.java   View Source Code Vote up 6 votes
@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);
}
 
Example 2
Project: DroidIPC   File: ServiceManagerImpl.java   View Source Code Vote up 6 votes
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();
	}
}
 
Example 3
Project: letv   File: MediaSessionCompat.java   View Source Code Vote up 5 votes
public Token createFromParcel(Parcel in) {
    Object readParcelable;
    if (VERSION.SDK_INT >= 21) {
        readParcelable = in.readParcelable(null);
    } else {
        readParcelable = in.readStrongBinder();
    }
    return new Token(readParcelable);
}
 
Example 4
Project: VirtualHook   File: PendingResultData.java   View Source Code Vote up 5 votes
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;
}
 
Example 5
Project: boohee_v5.6   File: MediaSessionCompat.java   View Source Code Vote up 5 votes
public Token createFromParcel(Parcel in) {
    Object readParcelable;
    if (VERSION.SDK_INT >= 21) {
        readParcelable = in.readParcelable(null);
    } else {
        readParcelable = in.readStrongBinder();
    }
    return new Token(readParcelable);
}
 
Example 6
Project: TPlayer   File: PendingResultData.java   View Source Code Vote up 5 votes
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;
}
 
Example 7
Project: container   File: PendingResultData.java   View Source Code Vote up 5 votes
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;
}
 
Example 8
Project: JobSchedulerCompat   File: GcmIntentParser.java   View Source Code Vote up 4 votes
/**
 * 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();
    }
}
 
Example 9
Project: atlas   File: ContentProviderHolder.java   View Source Code Vote up 4 votes
protected ContentProviderHolder(Parcel in) {
    info = in.readParcelable(ProviderInfo.class.getClassLoader());
    connection = in.readStrongBinder();
}
 
Example 10
Project: springreplugin   File: ParcelBinder.java   View Source Code Vote up 4 votes
private ParcelBinder(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
Example 11
Project: springreplugin   File: BinderCursor.java   View Source Code Vote up 4 votes
BinderParcelable(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
Example 12
Project: IPCServiceManager   File: BinderParcel.java   View Source Code Vote up 4 votes
private BinderParcel(Parcel source) {
    mBinder = source.readStrongBinder();
}
 
Example 13
Project: DroidIPC   File: ServiceManagerImpl.java   View Source Code Vote up 3 votes
@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;
}