Java Code Examples for android.os.Parcel#readException()

The following examples show how to use android.os.Parcel#readException() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ICustomTabsCallback.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void onNavigationEvent(int navigationEvent, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = 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, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

}
 
Example 2
Source File: IMediaSession.java    From letv with Apache License 2.0 6 votes vote down vote up
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
Source File: ICustomTabsCallback.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
public void onPostMessage(String message, Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

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

        this.mRemote.transact(5, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

}
 
Example 4
Source File: ICustomTabsCallback.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
public void onMessageChannelReady(Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

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

        this.mRemote.transact(4, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

}
 
Example 5
Source File: IMediaSession.java    From letv with Apache License 2.0 6 votes vote down vote up
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 6
Source File: ICustomTabsCallback.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
public void onMessageChannelReady(Bundle extras) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();

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

        this.mRemote.transact(4, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

}
 
Example 7
Source File: AttributionIdentifiers.java    From kognitivo with Apache License 2.0 6 votes vote down vote up
public boolean isTrackingLimited() throws RemoteException {
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    boolean limitAdTracking;
    try {
        data.writeInterfaceToken(
                "com.google.android.gms.ads.identifier.internal.IAdvertisingIdService");
        data.writeInt(1);
        binder.transact(SECOND_TRANSACTION_CODE, data, reply, 0);
        reply.readException();
        limitAdTracking = 0 != reply.readInt();
    } finally {
        reply.recycle();
        data.recycle();
    }
    return limitAdTracking;
}
 
Example 8
Source File: BookManagerImpl.java    From android-art-res with Apache License 2.0 6 votes vote down vote up
@Override
public List<Book> getBookList() throws RemoteException {
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    List<Book> result;
    try {
        data.writeInterfaceToken(DESCRIPTOR);
        mRemote.transact(TRANSACTION_getBookList, data, reply, 0);
        reply.readException();
        result = reply.createTypedArrayList(Book.CREATOR);
    } finally {
        reply.recycle();
        data.recycle();
    }
    return result;
}
 
Example 9
Source File: ICustomTabsService.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
public boolean newSession(ICustomTabsCallback callback) 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);
        this.mRemote.transact(3, _data, _reply, 0);
        _reply.readException();
        _result = 0 != _reply.readInt();
    } finally {
        _reply.recycle();
        _data.recycle();
    }

    return _result;
}
 
Example 10
Source File: d.java    From letv with Apache License 2.0 6 votes vote down vote up
public final String a(String str, String str2) {
    Parcel obtain = Parcel.obtain();
    Parcel obtain2 = Parcel.obtain();
    try {
        obtain.writeInterfaceToken(z);
        obtain.writeString(str);
        obtain.writeString(str2);
        this.a.transact(8, obtain, obtain2, 0);
        obtain2.readException();
        String readString = obtain2.readString();
        return readString;
    } finally {
        obtain2.recycle();
        obtain.recycle();
    }
}
 
Example 11
Source File: ICustomTabsService.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
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 12
Source File: ICdeBinder.java    From letv with Apache License 2.0 5 votes vote down vote up
public int getUpgradePercentage() throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        this.mRemote.transact(11, _data, _reply, 0);
        _reply.readException();
        int _result = _reply.readInt();
        return _result;
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 13
Source File: DeviceCallback.java    From letv with Apache License 2.0 5 votes vote down vote up
public void onFocusOnEditText(String deviceId, int editTextId, String currentText) throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        _data.writeString(deviceId);
        _data.writeInt(editTextId);
        _data.writeString(currentText);
        this.mRemote.transact(3, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 14
Source File: TmsCallbackProxy.java    From letv with Apache License 2.0 5 votes vote down vote up
public void onResultGot(int err, DataEntity result) throws RemoteException {
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    try {
        data.writeInt(err);
        result.writeToParcel(data, 0);
        this.mRemote.transact(1, data, reply, 0);
        reply.readException();
    } finally {
        data.recycle();
        reply.recycle();
    }
}
 
Example 15
Source File: ICustomTabsService.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
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
Source File: RubbishScanListenerProxy.java    From letv with Apache License 2.0 5 votes vote down vote up
public void onScanCanceled() throws RemoteException {
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    try {
        this.mRemote.transact(4, data, reply, 0);
        reply.readException();
    } finally {
        data.recycle();
        reply.recycle();
    }
}
 
Example 17
Source File: IMediaSession.java    From letv with Apache License 2.0 5 votes vote down vote up
public void fastForward() throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        this.mRemote.transact(22, _data, _reply, 0);
        _reply.readException();
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 18
Source File: RubbishScanListenerProxy.java    From letv with Apache License 2.0 5 votes vote down vote up
public void onScanStarted() throws RemoteException {
    Parcel data = Parcel.obtain();
    Parcel reply = Parcel.obtain();
    try {
        this.mRemote.transact(1, data, reply, 0);
        reply.readException();
    } finally {
        data.recycle();
        reply.recycle();
    }
}
 
Example 19
Source File: IMediaSession.java    From letv with Apache License 2.0 5 votes vote down vote up
public String getPackageName() throws RemoteException {
    Parcel _data = Parcel.obtain();
    Parcel _reply = Parcel.obtain();
    try {
        _data.writeInterfaceToken(Stub.DESCRIPTOR);
        this.mRemote.transact(6, _data, _reply, 0);
        _reply.readException();
        String _result = _reply.readString();
        return _result;
    } finally {
        _reply.recycle();
        _data.recycle();
    }
}
 
Example 20
Source File: ExceptionUtils.java    From letv with Apache License 2.0 5 votes vote down vote up
private static final void readExceptionFromParcel(Parcel reply, String msg, int code) {
    switch (code) {
        case 1:
            throw new DeviceUnavailableException(msg);
        default:
            reply.readException(code, msg);
            return;
    }
}