Example usage for android.database DatabaseUtils readExceptionFromParcel

List of usage examples for android.database DatabaseUtils readExceptionFromParcel

Introduction

In this page you can find the example usage for android.database DatabaseUtils readExceptionFromParcel.

Prototype

private static final void readExceptionFromParcel(Parcel reply, String msg, int code) 

Source Link

Usage

From source file:android.database.DatabaseUtils.java

/**
 * Special function for reading an exception result from the header of
 * a parcel, to be used after receiving the result of a transaction.  This
 * will throw the exception for you if it had been written to the Parcel,
 * otherwise return and let you read the normal result data from the Parcel.
 * @param reply Parcel to read from/*from  w  w w.j  a  v  a2s.  c  om*/
 * @see Parcel#writeNoException
 * @see Parcel#readException
 */
public static final void readExceptionFromParcel(Parcel reply) {
    int code = reply.readInt();
    if (code == 0)
        return;
    String msg = reply.readString();
    DatabaseUtils.readExceptionFromParcel(reply, msg, code);
}

From source file:android.database.DatabaseUtils.java

public static void readExceptionWithFileNotFoundExceptionFromParcel(Parcel reply) throws FileNotFoundException {
    int code = reply.readInt();
    if (code == 0)
        return;/*from  w w  w. ja v a 2 s . c  o m*/
    String msg = reply.readString();
    if (code == 1) {
        throw new FileNotFoundException(msg);
    } else {
        DatabaseUtils.readExceptionFromParcel(reply, msg, code);
    }
}

From source file:android.database.DatabaseUtils.java

public static void readExceptionWithOperationApplicationExceptionFromParcel(Parcel reply)
        throws OperationApplicationException {
    int code = reply.readInt();
    if (code == 0)
        return;/* w  w  w .j a va 2 s .com*/
    String msg = reply.readString();
    if (code == 10) {
        throw new OperationApplicationException(msg);
    } else {
        DatabaseUtils.readExceptionFromParcel(reply, msg, code);
    }
}