Java Code Examples for android.os.Bundle.writeToParcel()

The following are Jave code examples for showing how to use writeToParcel() of the android.os.Bundle 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: letv   File: IMediaSession.java   View Source Code Vote up 6 votes
public void playFromUri(Uri uri, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        if (uri != null) {
            _data.writeInt(1);
            uri.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(16, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 2
Project: boohee_v5.6   File: IMediaSession.java   View Source Code Vote up 6 votes
public void playFromSearch(String string, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeString(string);
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(15, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 3
Project: airgram   File: ICustomTabsCallback.java   View Source Code Vote up 6 votes
public void onNavigationEvent(int navigationEvent, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();

    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsCallback");
        _data.writeInt(navigationEvent);
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(2, _data, null, 1);
    } finally {
        _data.recycle();
    }

}
 
Example 4
Project: airgram   File: ICustomTabsCallback.java   View Source Code Vote up 6 votes
public void extraCallback(String callbackName, Bundle args) throws RemoteException {
    Parcel _data = Parcel.obtain();

    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsCallback");
        _data.writeString(callbackName);
        if (args != null) {
            _data.writeInt(1);
            args.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(3, _data, null, 1);
    } finally {
        _data.recycle();
    }

}
 
Example 5
Project: boohee_v5.6   File: IResultReceiver.java   View Source Code Vote up 6 votes
public void send(int resultCode, Bundle resultData) throws RemoteException {
    Parcel _data = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeInt(resultCode);
        if (resultData != null) {
            _data.writeInt(1);
            resultData.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(1, _data, null, 1);
    } finally {
        _data.recycle();
    }
}
 
Example 6
Project: letv   File: RemoteDeviceManager.java   View Source Code Vote up 6 votes
public void sendControlAction(String deviceId, String action, Bundle extra) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeString(deviceId);
        _data.writeString(action);
        if (extra != null) {
            _data.writeInt(1);
            extra.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(7, _data, _reply, 0);
        ExceptionUtils.readExceptionFromParcel(_reply);
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 7
Project: PlusGram   File: ICustomTabsCallback.java   View Source Code Vote up 6 votes
public void onNavigationEvent(int navigationEvent, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();

    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsCallback");
        _data.writeInt(navigationEvent);
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(2, _data, null, 1);
    } finally {
        _data.recycle();
    }

}
 
Example 8
Project: letv   File: AIDLService.java   View Source Code Vote up 6 votes
public void sendPush(Bundle bundle, String deId) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        if (bundle != null) {
            _data.writeInt(1);
            bundle.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        _data.writeString(deId);
        this.mRemote.transact(4, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 9
Project: letv   File: IMediaControllerCallback.java   View Source Code Vote up 6 votes
public void onEvent(String event, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeString(event);
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(1, _data, null, 1);
    } finally {
        _data.recycle();
    }
}
 
Example 10
Project: letv   File: IMediaSession.java   View Source Code Vote up 6 votes
public void playFromMediaId(String uri, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeString(uri);
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(14, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 11
Project: PlusGram   File: ICustomTabsService.java   View Source Code Vote up 6 votes
public boolean updateVisuals(ICustomTabsCallback callback, Bundle bundle) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    boolean _result;
    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
        _data.writeStrongBinder(callback != null ? callback.asBinder() : null);
        if (bundle != null) {
            _data.writeInt(1);
            bundle.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(6, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
Example 12
Project: dcs-sdk-java   File: AccessTokenManager.java   View Source Code Vote up 5 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
    Bundle bundle = new Bundle();
    if (this.accessToken != null) {
        bundle.putString(OauthConfig.BundleKey.KEY_ACCESS_TOKEN, this.accessToken);
    }
    if (this.expireTime != 0) {
        bundle.putLong(OauthConfig.BundleKey.KEY_EXPIRE_TIME, this.expireTime);
    }
    bundle.writeToParcel(dest, flags);
}
 
Example 13
Project: dcs-sdk-java   File: BaiduOauthImplicitGrant.java   View Source Code Vote up 5 votes
@Override
public void writeToParcel(Parcel dest, int flags) {
    Bundle bundle = new Bundle();
    bundle.putString(KEY_CLIENT_ID, this.cliendId);
    bundle.writeToParcel(dest, flags);
    this.accessTokenManager.writeToParcel(dest, flags);
}
 
Example 14
Project: airgram   File: ICustomTabsService.java   View Source Code Vote up 5 votes
public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url, Bundle extras, List<Bundle> otherLikelyBundles) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    boolean _result;
    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
        _data.writeStrongBinder(callback != null ? callback.asBinder() : null);
        if (url != null) {
            _data.writeInt(1);
            url.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        _data.writeTypedList(otherLikelyBundles);
        this.mRemote.transact(4, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
Example 15
Project: airgram   File: ICustomTabsService.java   View Source Code Vote up 5 votes
public Bundle extraCommand(String commandName, Bundle args) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    Bundle _result;
    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
        _data.writeString(commandName);
        if (args != null) {
            _data.writeInt(1);
            args.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        this.mRemote.transact(5, _data, _reply, 0);
        _reply.readException();
        if (0 != _reply.readInt()) {
            _result = Bundle.CREATOR.createFromParcel(_reply);
        } else {
            _result = null;
        }
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
Example 16
Project: PlusGram   File: ICustomTabsService.java   View Source Code Vote up 5 votes
public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url, Bundle extras, List<Bundle> otherLikelyBundles) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

    boolean _result;
    try {
        _data.writeInterfaceToken("android.support.customtabs.ICustomTabsService");
        _data.writeStrongBinder(callback != null ? callback.asBinder() : null);
        if (url != null) {
            _data.writeInt(1);
            url.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }

        _data.writeTypedList(otherLikelyBundles);
        this.mRemote.transact(4, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
Example 17
Project: chromium-for-android-56-debug-video   File: InvalidationGcmUpstreamSender.java   View Source Code Vote up 5 votes
@SuppressLint("ParcelClassLoader")
private Bundle createDeepCopy(Bundle original) {
    Parcel temp = Parcel.obtain();
    original.writeToParcel(temp, 0);
    temp.setDataPosition(0);
    Bundle copy = temp.readBundle();
    temp.recycle();
    return copy;
}
 
Example 18
Project: letv   File: IMediaControllerCallback.java   View Source Code Vote up 5 votes
public void onExtrasChanged(Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(7, _data, null, 1);
    } finally {
        _data.recycle();
    }
}
 
Example 19
Project: boohee_v5.6   File: IMediaControllerCallback.java   View Source Code Vote up 5 votes
public void onExtrasChanged(Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        if (extras != null) {
            _data.writeInt(1);
            extras.writeToParcel(_data, 0);
        } else {
            _data.writeInt(0);
        }
        this.mRemote.transact(7, _data, null, 1);
    } finally {
        _data.recycle();
    }
}
 
Example 20
Project: garras   File: Bundler.java   View Source Code Vote up 4 votes
public static boolean isValidBundleSize(@NonNull Bundle bundle) {
    Parcel parcel = Parcel.obtain();
    bundle.writeToParcel(parcel, 0);
    return parcel.dataSize() < 500000;
}