| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.accounts; |
| 18 |
|
| 19 |
import android.os.Bundle; |
| 20 |
import android.os.Parcel; |
| 21 |
import android.os.Parcelable; |
| 22 |
import android.os.RemoteException; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public class AccountManagerResponse implements Parcelable { |
| 29 |
private IAccountManagerResponse mResponse; |
| 30 |
|
| 31 |
|
| 32 |
public AccountManagerResponse(IAccountManagerResponse response) { |
| 33 |
mResponse = response; |
| 34 |
} |
| 35 |
|
| 36 |
|
| 37 |
public AccountManagerResponse(Parcel parcel) { |
| 38 |
mResponse = |
| 39 |
IAccountManagerResponse.Stub.asInterface(parcel.readStrongBinder()); |
| 40 |
} |
| 41 |
|
| 42 |
public void onResult(Bundle result) { |
| 43 |
try { |
| 44 |
mResponse.onResult(result); |
| 45 |
} catch (RemoteException e) { |
| 46 |
|
| 47 |
} |
| 48 |
} |
| 49 |
|
| 50 |
public void onError(int errorCode, String errorMessage) { |
| 51 |
try { |
| 52 |
mResponse.onError(errorCode, errorMessage); |
| 53 |
} catch (RemoteException e) { |
| 54 |
|
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
public int describeContents() { |
| 60 |
return 0; |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
public void writeToParcel(Parcel dest, int flags) { |
| 65 |
dest.writeStrongBinder(mResponse.asBinder()); |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
public static final @android.annotation.NonNull Creator<AccountManagerResponse> CREATOR = |
| 70 |
new Creator<AccountManagerResponse>() { |
| 71 |
public AccountManagerResponse createFromParcel(Parcel source) { |
| 72 |
return new AccountManagerResponse(source); |
| 73 |
} |
| 74 |
|
| 75 |
public AccountManagerResponse[] newArray(int size) { |
| 76 |
return new AccountManagerResponse[size]; |
| 77 |
} |
| 78 |
}; |
| 79 |
} |