Loading Android.mk +12 −2 Original line number Diff line number Diff line Loading @@ -343,7 +343,7 @@ framework_docs_LOCAL_DROIDDOC_OPTIONS := \ -since ./frameworks/base/api/2.xml 2 \ -since ./frameworks/base/api/3.xml 3 \ -since ./frameworks/base/api/4.xml 4 \ -since ./frameworks/base/api/current.xml Eclair \ -since ./frameworks/base/api/5.xml 5 \ -error 1 -error 2 -warning 3 -error 4 -error 6 -error 8 \ -overview $(LOCAL_PATH)/core/java/overview.html Loading Loading @@ -380,10 +380,20 @@ framework_docs_SDK_CURRENT_DIR:=$(framework_docs_SDK_VERSION)_r$(framework_docs_ # flag to build offline docs for a preview release framework_docs_SDK_PREVIEW:=0 ## Latest ADT version identifiers, for reference from published docs framework_docs_ADT_VERSION:=0.9.4 framework_docs_ADT_DOWNLOAD:=ADT-0.9.4.zip framework_docs_ADT_BYTES:=3367536 framework_docs_ADT_CHECKSUM:=4cdecd72b3e28022d8a55891f13e7d43 framework_docs_LOCAL_DROIDDOC_OPTIONS += \ -hdf sdk.version $(framework_docs_SDK_VERSION) \ -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \ -hdf sdk.current $(framework_docs_SDK_CURRENT_DIR) -hdf sdk.current $(framework_docs_SDK_CURRENT_DIR) \ -hdf adt.zip.version $(framework_docs_ADT_VERSION) \ -hdf adt.zip.download $(framework_docs_ADT_DOWNLOAD) \ -hdf adt.zip.bytes $(framework_docs_ADT_BYTES) \ -hdf adt.zip.checksum $(framework_docs_ADT_CHECKSUM) # ==== the api stubs and current.xml =========================== include $(CLEAR_VARS) Loading api/current.xml +23 −0 Original line number Diff line number Diff line Loading @@ -24659,6 +24659,29 @@ visibility="public" > </method> <method name="sendWallpaperCommand" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="windowToken" type="android.os.IBinder"> </parameter> <parameter name="action" type="java.lang.String"> </parameter> <parameter name="x" type="int"> </parameter> <parameter name="y" type="int"> </parameter> <parameter name="z" type="int"> </parameter> <parameter name="extras" type="android.os.Bundle"> </parameter> </method> <method name="setBitmap" return="void" abstract="false" core/java/android/accounts/AbstractAccountAuthenticator.java +188 −3 Original line number Diff line number Diff line Loading @@ -26,9 +26,78 @@ import android.content.Intent; import android.Manifest; /** * Base class for creating AccountAuthenticators. This implements the IAccountAuthenticator * binder interface and also provides helper libraries to simplify the creation of * AccountAuthenticators. * Abstract base class for creating AccountAuthenticators. * In order to be an authenticator one must extend this class, provider implementations for the * abstract methods and write a service that returns the result of {@link #getIBinder()} * in the service's {@link android.app.Service#onBind(android.content.Intent)} when invoked * with an intent with action {@link AccountManager#ACTION_AUTHENTICATOR_INTENT}. This service * must specify the following intent filter and metadata tags in its AndroidManifest.xml file * <pre> * <intent-filter> * <action android:name="android.accounts.AccountAuthenticator" /> * </intent-filter> * <meta-data android:name="android.accounts.AccountAuthenticator" * android:resource="@xml/authenticator" /> * </pre> * The <code>android:resource</code> attribute must point to a resource that looks like: * <pre> * <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android" * android:accountType="typeOfAuthenticator" * android:icon="@drawable/icon" * android:smallIcon="@drawable/miniIcon" * android:label="@string/label" * android:accountPreferences="@xml/account_preferences" * /> * </pre> * Replace the icons and labels with your own resources. The <code>android:accountType</code> * attribute must be a string that uniquely identifies your authenticator and will be the same * string that user will use when making calls on the {@link AccountManager} and it also * corresponds to {@link Account#type} for your accounts. One user of the android:icon is the * "Account & Sync" settings page and one user of the android:smallIcon is the Contact Application's * tab panels. * <p> * The preferences attribute points to an PreferenceScreen xml hierarchy that contains * a list of PreferenceScreens that can be invoked to manage the authenticator. An example is: * <pre> * <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> * <PreferenceCategory android:title="@string/title_fmt" /> * <PreferenceScreen * android:key="key1" * android:title="@string/key1_action" * android:summary="@string/key1_summary"> * <intent * android:action="key1.ACTION" * android:targetPackage="key1.package" * android:targetClass="key1.class" /> * </PreferenceScreen> * </PreferenceScreen> * </pre> * * <p> * The standard pattern for implementing any of the abstract methods is the following: * <ul> * <li> If the supplied arguments are enough for the authenticator to fully satisfy the request * then it will do so and return a {@link Bundle} that contains the results. * <li> If the authenticator needs information from the user to satisfy the request then it * will create an {@link Intent} to an activity that will prompt the user for the information * and then carry out the request. This intent must be returned in a Bundle as key * {@link AccountManager#KEY_INTENT}. * <p> * The activity needs to return the final result when it is complete so the Intent should contain * the {@link AccountAuthenticatorResponse} as {@link AccountManager#KEY_ACCOUNT_MANAGER_RESPONSE}. * The activity must then call {@link AccountAuthenticatorResponse#onResult} or * {@link AccountAuthenticatorResponse#onError} when it is complete. * </ul> * <p> * The following descriptions of each of the abstract authenticator methods will not describe the * possible asynchronous nature of the request handling and will instead just describe the input * parameters and the expected result. * <p> * When writing an activity to satisfy these requests one must pass in the AccountManagerResponse * and return the result via that response when the activity finishes (or whenever else the * activity author deems it is the correct time to respond). * The {@link AccountAuthenticatorActivity} handles this, so one may wish to extend that when * writing activities to handle these requests. */ public abstract class AbstractAccountAuthenticator { private final Context mContext; Loading Loading @@ -239,19 +308,135 @@ public abstract class AbstractAccountAuthenticator { */ public abstract Bundle editProperties(AccountAuthenticatorResponse response, String accountType); /** * Adds an account of the specified accountType. * @param response to send the result back to the AccountManager, will never be null * @param accountType the type of account to add, will never be null * @param authTokenType the type of auth token to retrieve after adding the account, may be null * @param requiredFeatures a String array of authenticator-specific features that the added * account must support, may be null * @param options a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME} and {@link AccountManager#KEY_ACCOUNT_TYPE} of * the account that was added, plus {@link AccountManager#KEY_AUTHTOKEN} if an authTokenType * was supplied, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public abstract Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException; /** * Checks that the user knows the credentials of an account. * @param response to send the result back to the AccountManager, will never be null * @param account the account whose credentials are to be checked, will never be null * @param options a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_BOOLEAN_RESULT}, true if the check succeeded, false otherwise * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> */ public abstract Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options); /** * Gets the authtoken for an account. * @param response to send the result back to the AccountManager, will never be null * @param account the account whose credentials are to be retrieved, will never be null * @param authTokenType the type of auth token to retrieve, will never be null * @param loginOptions a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME}, {@link AccountManager#KEY_ACCOUNT_TYPE}, * and {@link AccountManager#KEY_AUTHTOKEN}, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public abstract Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle loginOptions) throws NetworkErrorException; /** * Ask the authenticator for a localized label for the given authTokenType. * @param authTokenType the authTokenType whose label is to be returned, will never be null * @return the localized label of the auth token type, may be null if the type isn't known */ public abstract String getAuthTokenLabel(String authTokenType); /** * Update the locally stored credentials for an account. * @param response to send the result back to the AccountManager, will never be null * @param account the account whose credentials are to be updated, will never be null * @param authTokenType the type of auth token to retrieve after updating the credentials, * may be null * @param loginOptions a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME} and {@link AccountManager#KEY_ACCOUNT_TYPE} of * the account that was added, plus {@link AccountManager#KEY_AUTHTOKEN} if an authTokenType * was supplied, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> */ public abstract Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle loginOptions); /** * Checks if the account supports all the specified authenticator specific features. * @param response to send the result back to the AccountManager, will never be null * @param account the account to check, will never be null * @param features an array of features to check, will never be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_BOOLEAN_RESULT}, true if the account has all the features, * false otherwise * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public abstract Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) throws NetworkErrorException; /** * Checks if the removal of this account is allowed. * @param response to send the result back to the AccountManager, will never be null * @param account the account to check, will never be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_BOOLEAN_RESULT}, true if the removal of the account is * allowed, false otherwise * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public Bundle getAccountRemovalAllowed(AccountAuthenticatorResponse response, Account account) throws NetworkErrorException { final Bundle result = new Bundle(); Loading core/java/android/accounts/AccountAuthenticatorActivity.java +9 −13 Original line number Diff line number Diff line Loading @@ -22,21 +22,17 @@ import android.os.Bundle; /** * Base class for implementing an Activity that is used to help implement an * AbstractAccountAuthenticator. If the AbstractAccountAuthenticator needs to return an Intent * that is to be used to launch an Activity that needs to return results to satisfy an * AbstractAccountAuthenticator request, it should store the AccountAuthenticatorResponse * inside of the Intent as follows: * <p> * AbstractAccountAuthenticator. If the AbstractAccountAuthenticator needs to use an activity * to handle the request then it can have the activity extend AccountAuthenticatorActivity. * The AbstractAccountAuthenticator passes in the response to the intent using the following: * <pre> * intent.putExtra(Constants.ACCOUNT_AUTHENTICATOR_RESPONSE_KEY, response); * <p> * The activity that it launches should extend the AccountAuthenticatorActivity. If this * activity has a result that satisfies the original request it sets it via: * <p> * setAccountAuthenticatorResult(result) * <p> * </pre> * The activity then sets the result that is to be handed to the response via * {@link #setAccountAuthenticatorResult(android.os.Bundle)}. * This result will be sent as the result of the request when the activity finishes. If this * is never set or if it is set to null then the request will be canceled when the activity * finishes. * is never set or if it is set to null then error {@link AccountManager#ERROR_CODE_CANCELED} * will be called on the response. */ public class AccountAuthenticatorActivity extends Activity { private AccountAuthenticatorResponse mAccountAuthenticatorResponse = null; Loading Loading
Android.mk +12 −2 Original line number Diff line number Diff line Loading @@ -343,7 +343,7 @@ framework_docs_LOCAL_DROIDDOC_OPTIONS := \ -since ./frameworks/base/api/2.xml 2 \ -since ./frameworks/base/api/3.xml 3 \ -since ./frameworks/base/api/4.xml 4 \ -since ./frameworks/base/api/current.xml Eclair \ -since ./frameworks/base/api/5.xml 5 \ -error 1 -error 2 -warning 3 -error 4 -error 6 -error 8 \ -overview $(LOCAL_PATH)/core/java/overview.html Loading Loading @@ -380,10 +380,20 @@ framework_docs_SDK_CURRENT_DIR:=$(framework_docs_SDK_VERSION)_r$(framework_docs_ # flag to build offline docs for a preview release framework_docs_SDK_PREVIEW:=0 ## Latest ADT version identifiers, for reference from published docs framework_docs_ADT_VERSION:=0.9.4 framework_docs_ADT_DOWNLOAD:=ADT-0.9.4.zip framework_docs_ADT_BYTES:=3367536 framework_docs_ADT_CHECKSUM:=4cdecd72b3e28022d8a55891f13e7d43 framework_docs_LOCAL_DROIDDOC_OPTIONS += \ -hdf sdk.version $(framework_docs_SDK_VERSION) \ -hdf sdk.rel.id $(framework_docs_SDK_REL_ID) \ -hdf sdk.current $(framework_docs_SDK_CURRENT_DIR) -hdf sdk.current $(framework_docs_SDK_CURRENT_DIR) \ -hdf adt.zip.version $(framework_docs_ADT_VERSION) \ -hdf adt.zip.download $(framework_docs_ADT_DOWNLOAD) \ -hdf adt.zip.bytes $(framework_docs_ADT_BYTES) \ -hdf adt.zip.checksum $(framework_docs_ADT_CHECKSUM) # ==== the api stubs and current.xml =========================== include $(CLEAR_VARS) Loading
api/current.xml +23 −0 Original line number Diff line number Diff line Loading @@ -24659,6 +24659,29 @@ visibility="public" > </method> <method name="sendWallpaperCommand" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="windowToken" type="android.os.IBinder"> </parameter> <parameter name="action" type="java.lang.String"> </parameter> <parameter name="x" type="int"> </parameter> <parameter name="y" type="int"> </parameter> <parameter name="z" type="int"> </parameter> <parameter name="extras" type="android.os.Bundle"> </parameter> </method> <method name="setBitmap" return="void" abstract="false"
core/java/android/accounts/AbstractAccountAuthenticator.java +188 −3 Original line number Diff line number Diff line Loading @@ -26,9 +26,78 @@ import android.content.Intent; import android.Manifest; /** * Base class for creating AccountAuthenticators. This implements the IAccountAuthenticator * binder interface and also provides helper libraries to simplify the creation of * AccountAuthenticators. * Abstract base class for creating AccountAuthenticators. * In order to be an authenticator one must extend this class, provider implementations for the * abstract methods and write a service that returns the result of {@link #getIBinder()} * in the service's {@link android.app.Service#onBind(android.content.Intent)} when invoked * with an intent with action {@link AccountManager#ACTION_AUTHENTICATOR_INTENT}. This service * must specify the following intent filter and metadata tags in its AndroidManifest.xml file * <pre> * <intent-filter> * <action android:name="android.accounts.AccountAuthenticator" /> * </intent-filter> * <meta-data android:name="android.accounts.AccountAuthenticator" * android:resource="@xml/authenticator" /> * </pre> * The <code>android:resource</code> attribute must point to a resource that looks like: * <pre> * <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android" * android:accountType="typeOfAuthenticator" * android:icon="@drawable/icon" * android:smallIcon="@drawable/miniIcon" * android:label="@string/label" * android:accountPreferences="@xml/account_preferences" * /> * </pre> * Replace the icons and labels with your own resources. The <code>android:accountType</code> * attribute must be a string that uniquely identifies your authenticator and will be the same * string that user will use when making calls on the {@link AccountManager} and it also * corresponds to {@link Account#type} for your accounts. One user of the android:icon is the * "Account & Sync" settings page and one user of the android:smallIcon is the Contact Application's * tab panels. * <p> * The preferences attribute points to an PreferenceScreen xml hierarchy that contains * a list of PreferenceScreens that can be invoked to manage the authenticator. An example is: * <pre> * <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> * <PreferenceCategory android:title="@string/title_fmt" /> * <PreferenceScreen * android:key="key1" * android:title="@string/key1_action" * android:summary="@string/key1_summary"> * <intent * android:action="key1.ACTION" * android:targetPackage="key1.package" * android:targetClass="key1.class" /> * </PreferenceScreen> * </PreferenceScreen> * </pre> * * <p> * The standard pattern for implementing any of the abstract methods is the following: * <ul> * <li> If the supplied arguments are enough for the authenticator to fully satisfy the request * then it will do so and return a {@link Bundle} that contains the results. * <li> If the authenticator needs information from the user to satisfy the request then it * will create an {@link Intent} to an activity that will prompt the user for the information * and then carry out the request. This intent must be returned in a Bundle as key * {@link AccountManager#KEY_INTENT}. * <p> * The activity needs to return the final result when it is complete so the Intent should contain * the {@link AccountAuthenticatorResponse} as {@link AccountManager#KEY_ACCOUNT_MANAGER_RESPONSE}. * The activity must then call {@link AccountAuthenticatorResponse#onResult} or * {@link AccountAuthenticatorResponse#onError} when it is complete. * </ul> * <p> * The following descriptions of each of the abstract authenticator methods will not describe the * possible asynchronous nature of the request handling and will instead just describe the input * parameters and the expected result. * <p> * When writing an activity to satisfy these requests one must pass in the AccountManagerResponse * and return the result via that response when the activity finishes (or whenever else the * activity author deems it is the correct time to respond). * The {@link AccountAuthenticatorActivity} handles this, so one may wish to extend that when * writing activities to handle these requests. */ public abstract class AbstractAccountAuthenticator { private final Context mContext; Loading Loading @@ -239,19 +308,135 @@ public abstract class AbstractAccountAuthenticator { */ public abstract Bundle editProperties(AccountAuthenticatorResponse response, String accountType); /** * Adds an account of the specified accountType. * @param response to send the result back to the AccountManager, will never be null * @param accountType the type of account to add, will never be null * @param authTokenType the type of auth token to retrieve after adding the account, may be null * @param requiredFeatures a String array of authenticator-specific features that the added * account must support, may be null * @param options a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME} and {@link AccountManager#KEY_ACCOUNT_TYPE} of * the account that was added, plus {@link AccountManager#KEY_AUTHTOKEN} if an authTokenType * was supplied, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public abstract Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException; /** * Checks that the user knows the credentials of an account. * @param response to send the result back to the AccountManager, will never be null * @param account the account whose credentials are to be checked, will never be null * @param options a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_BOOLEAN_RESULT}, true if the check succeeded, false otherwise * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> */ public abstract Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options); /** * Gets the authtoken for an account. * @param response to send the result back to the AccountManager, will never be null * @param account the account whose credentials are to be retrieved, will never be null * @param authTokenType the type of auth token to retrieve, will never be null * @param loginOptions a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME}, {@link AccountManager#KEY_ACCOUNT_TYPE}, * and {@link AccountManager#KEY_AUTHTOKEN}, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public abstract Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle loginOptions) throws NetworkErrorException; /** * Ask the authenticator for a localized label for the given authTokenType. * @param authTokenType the authTokenType whose label is to be returned, will never be null * @return the localized label of the auth token type, may be null if the type isn't known */ public abstract String getAuthTokenLabel(String authTokenType); /** * Update the locally stored credentials for an account. * @param response to send the result back to the AccountManager, will never be null * @param account the account whose credentials are to be updated, will never be null * @param authTokenType the type of auth token to retrieve after updating the credentials, * may be null * @param loginOptions a Bundle of authenticator-specific options, may be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_ACCOUNT_NAME} and {@link AccountManager#KEY_ACCOUNT_TYPE} of * the account that was added, plus {@link AccountManager#KEY_AUTHTOKEN} if an authTokenType * was supplied, or * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> */ public abstract Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle loginOptions); /** * Checks if the account supports all the specified authenticator specific features. * @param response to send the result back to the AccountManager, will never be null * @param account the account to check, will never be null * @param features an array of features to check, will never be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_BOOLEAN_RESULT}, true if the account has all the features, * false otherwise * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public abstract Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) throws NetworkErrorException; /** * Checks if the removal of this account is allowed. * @param response to send the result back to the AccountManager, will never be null * @param account the account to check, will never be null * @return a Bundle result or null if the result is to be returned via the response. The result * will contain either: * <ul> * <li> {@link AccountManager#KEY_INTENT}, or * <li> {@link AccountManager#KEY_BOOLEAN_RESULT}, true if the removal of the account is * allowed, false otherwise * <li> {@link AccountManager#KEY_ERROR_CODE} and {@link AccountManager#KEY_ERROR_MESSAGE} to * indicate an error * </ul> * @throws NetworkErrorException if the authenticator could not honor the request due to a * network error */ public Bundle getAccountRemovalAllowed(AccountAuthenticatorResponse response, Account account) throws NetworkErrorException { final Bundle result = new Bundle(); Loading
core/java/android/accounts/AccountAuthenticatorActivity.java +9 −13 Original line number Diff line number Diff line Loading @@ -22,21 +22,17 @@ import android.os.Bundle; /** * Base class for implementing an Activity that is used to help implement an * AbstractAccountAuthenticator. If the AbstractAccountAuthenticator needs to return an Intent * that is to be used to launch an Activity that needs to return results to satisfy an * AbstractAccountAuthenticator request, it should store the AccountAuthenticatorResponse * inside of the Intent as follows: * <p> * AbstractAccountAuthenticator. If the AbstractAccountAuthenticator needs to use an activity * to handle the request then it can have the activity extend AccountAuthenticatorActivity. * The AbstractAccountAuthenticator passes in the response to the intent using the following: * <pre> * intent.putExtra(Constants.ACCOUNT_AUTHENTICATOR_RESPONSE_KEY, response); * <p> * The activity that it launches should extend the AccountAuthenticatorActivity. If this * activity has a result that satisfies the original request it sets it via: * <p> * setAccountAuthenticatorResult(result) * <p> * </pre> * The activity then sets the result that is to be handed to the response via * {@link #setAccountAuthenticatorResult(android.os.Bundle)}. * This result will be sent as the result of the request when the activity finishes. If this * is never set or if it is set to null then the request will be canceled when the activity * finishes. * is never set or if it is set to null then error {@link AccountManager#ERROR_CODE_CANCELED} * will be called on the response. */ public class AccountAuthenticatorActivity extends Activity { private AccountAuthenticatorResponse mAccountAuthenticatorResponse = null; Loading