| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.accounts; |
| 18 |
|
| 19 |
import android.compat.annotation.UnsupportedAppUsage; |
| 20 |
import android.os.Bundle; |
| 21 |
import android.os.Parcel; |
| 22 |
import android.os.Parcelable; |
| 23 |
import android.os.RemoteException; |
| 24 |
import android.util.Log; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public class AccountAuthenticatorResponse implements Parcelable { |
| 30 |
private static final String TAG = "AccountAuthenticator"; |
| 31 |
|
| 32 |
private IAccountAuthenticatorResponse mAccountAuthenticatorResponse; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
@UnsupportedAppUsage |
| 38 |
public AccountAuthenticatorResponse(IAccountAuthenticatorResponse response) { |
| 39 |
mAccountAuthenticatorResponse = response; |
| 40 |
} |
| 41 |
|
| 42 |
public AccountAuthenticatorResponse(Parcel parcel) { |
| 43 |
mAccountAuthenticatorResponse = |
| 44 |
IAccountAuthenticatorResponse.Stub.asInterface(parcel.readStrongBinder()); |
| 45 |
} |
| 46 |
|
| 47 |
public void onResult(Bundle result) { |
| 48 |
if (Log.isLoggable(TAG, Log.VERBOSE)) { |
| 49 |
result.keySet(); |
| 50 |
Log.v(TAG, "AccountAuthenticatorResponse.onResult: " |
| 51 |
+ AccountManager.sanitizeResult(result)); |
| 52 |
} |
| 53 |
try { |
| 54 |
mAccountAuthenticatorResponse.onResult(result); |
| 55 |
} catch (RemoteException e) { |
| 56 |
|
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
public void onRequestContinued() { |
| 61 |
if (Log.isLoggable(TAG, Log.VERBOSE)) { |
| 62 |
Log.v(TAG, "AccountAuthenticatorResponse.onRequestContinued"); |
| 63 |
} |
| 64 |
try { |
| 65 |
mAccountAuthenticatorResponse.onRequestContinued(); |
| 66 |
} catch (RemoteException e) { |
| 67 |
|
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
public void onError(int errorCode, String errorMessage) { |
| 72 |
if (Log.isLoggable(TAG, Log.VERBOSE)) { |
| 73 |
Log.v(TAG, "AccountAuthenticatorResponse.onError: " + errorCode + ", " + errorMessage); |
| 74 |
} |
| 75 |
try { |
| 76 |
mAccountAuthenticatorResponse.onError(errorCode, errorMessage); |
| 77 |
} catch (RemoteException e) { |
| 78 |
|
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
public int describeContents() { |
| 83 |
return 0; |
| 84 |
} |
| 85 |
|
| 86 |
public void writeToParcel(Parcel dest, int flags) { |
| 87 |
dest.writeStrongBinder(mAccountAuthenticatorResponse.asBinder()); |
| 88 |
} |
| 89 |
|
| 90 |
public static final @android.annotation.NonNull Creator<AccountAuthenticatorResponse> CREATOR = |
| 91 |
new Creator<AccountAuthenticatorResponse>() { |
| 92 |
public AccountAuthenticatorResponse createFromParcel(Parcel source) { |
| 93 |
return new AccountAuthenticatorResponse(source); |
| 94 |
} |
| 95 |
|
| 96 |
public AccountAuthenticatorResponse[] newArray(int size) { |
| 97 |
return new AccountAuthenticatorResponse[size]; |
| 98 |
} |
| 99 |
}; |
| 100 |
} |