Projects >> platform_frameworks_base >>c039bb5d1ee13660142595bf21b4ac1d1ae129a5

Chunk
Conflicting content
                    com.android.internal.R.styleable.AccountAuthenticator_smallIcon, 0);
            final int prefId = sa.getResourceId(
                    com.android.internal.R.styleable.AccountAuthenticator_accountPreferences, 0);
<<<<<<< HEAD
            final boolean customTokens = sa.getBoolean(
                    com.android.internal.R.styleable.AccountAuthenticator_customTokens, false);
=======
            
            boolean customTokens = false;
            try {
                // In HC this will be an attribute in authenticator.xml, this is a workaround
                // using meta-data to avoid changes to the API. 
                // If meta-data is absent the old behavior is preserved. 
                // Authenticator will know if AccountManager supports customTokens or not.
                PackageManager pm = mContext.getPackageManager();
                List resolveInfos = pm.queryIntentServices(
                        new Intent(AccountManager.ACTION_AUTHENTICATOR_INTENT),
                        PackageManager.GET_META_DATA);
                for (ResolveInfo resolveInfo: resolveInfos) {
                    android.content.pm.ServiceInfo si = resolveInfo.serviceInfo;
                    if (!packageName.equals(si.packageName)) {
                        continue;
                    }
                    Object ctString = si.metaData.get(AccountManager.ACTION_AUTHENTICATOR_INTENT 
                            + ".customTokens");
                    if (ctString != null) {
                        customTokens = true;
                    }
                }
            } catch (Throwable t) {
                // Protected against invalid data in meta or unexpected 
                // conditions - the authenticator will not have the new 
                // features. 
                Log.e(TAG, "Error getting customTokens metadata " + t);
            }
            
>>>>>>> 66d46ac61478c967ed45bd1c27b0436654d54299
            if (TextUtils.isEmpty(accountType)) {
                return null;
            }
Solution content
                    com.android.internal.R.styleable.AccountAuthenticator_smallIcon, 0);
            final int prefId = sa.getResourceId(
                    com.android.internal.R.styleable.AccountAuthenticator_accountPreferences, 0);
            final boolean customTokens = sa.getBoolean(
                    com.android.internal.R.styleable.AccountAuthenticator_customTokens, false);
            if (TextUtils.isEmpty(accountType)) {
                return null;
            }
File
AccountAuthenticatorCache.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Try statement
Variable
Chunk
Conflicting content
    /**
     * Authenticators using 'customTokens' option will also get the UID of the
     * caller
<<<<<<< HEAD
     */
    public static final String KEY_CALLER_UID = "callerUid";
=======
     * @hide
     */
    public static final String KEY_CALLER_UID = "callerUid";

    /**
     * @hide 
     */
>>>>>>> 66d46ac61478c967ed45bd1c27b0436654d54299
    public static final String KEY_CALLER_PID = "callerPid";

    /**
Solution content
    /**
     * Authenticators using 'customTokens' option will also get the UID of the
     * caller
     */
    public static final String KEY_CALLER_UID = "callerUid";
    public static final String KEY_CALLER_PID = "callerPid";

    /**
File
AccountManager.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
Chunk
Conflicting content
    public AccountManagerService(Context context, PackageManager packageManager,
            IAccountAuthenticatorCache authenticatorCache) {
        mContext = context;
<<<<<<< HEAD
        mPackageManager = packageManager;
=======
        mPackageManager = context.getPackageManager();
>>>>>>> 66d46ac61478c967ed45bd1c27b0436654d54299

        mOpenHelper = new DatabaseHelper(mContext);
Solution content
    public AccountManagerService(Context context, PackageManager packageManager,
            IAccountAuthenticatorCache authenticatorCache) {
        mContext = context;
        mPackageManager = packageManager;

        mOpenHelper = new DatabaseHelper(mContext);
File
AccountManagerService.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Variable
Chunk
Conflicting content
            // if the caller has permission, do the peek. otherwise go the more expensive
            // route of starting a Session
            if (!customTokens && permissionGranted) {
<<<<<<< HEAD
                String authToken = readAuthTokenFromCache(account, authTokenType);
=======
                String authToken = readAuthTokenFromDatabase(account, authTokenType);
>>>>>>> 66d46ac61478c967ed45bd1c27b0436654d54299
                if (authToken != null) {
                    Bundle result = new Bundle();
                    result.putString(AccountManager.KEY_AUTHTOKEN, authToken);
Solution content
            // if the caller has permission, do the peek. otherwise go the more expensive
            // route of starting a Session
            if (!customTokens && permissionGranted) {
                String authToken = readAuthTokenFromCache(account, authTokenType);
                if (authToken != null) {
                    Bundle result = new Bundle();
                    result.putString(AccountManager.KEY_AUTHTOKEN, authToken);
File
AccountManagerService.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
            AccountAuthenticatorResponse response, String authTokenType, String authTokenLabel) {

        Intent intent = new Intent(mContext, GrantCredentialsPermissionActivity.class);
<<<<<<< HEAD
        // See FLAT_ACTIVITY_NEW_TASK docs for limitations and benefits of the flag.
=======
        // See FLAG_ACTIVITY_NEW_TASK docs for limitations and benefits of the flag.
>>>>>>> 66d46ac61478c967ed45bd1c27b0436654d54299
        // Since it was set in Eclair+ we can't change it without breaking apps using
        // the intent from a non-Activity context.
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Solution content
            AccountAuthenticatorResponse response, String authTokenType, String authTokenLabel) {

        Intent intent = new Intent(mContext, GrantCredentialsPermissionActivity.class);
        // See FLAT_ACTIVITY_NEW_TASK docs for limitations and benefits of the flag.
        // Since it was set in Eclair+ we can't change it without breaking apps using
        // the intent from a non-Activity context.
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
File
AccountManagerService.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
    /** The package name that can be used to lookup the resources from above. */
    final public String packageName;

<<<<<<< HEAD
    /** Authenticator handles its own token caching and permission screen */
    final public boolean customTokens;

    /** A constructor for a full AuthenticatorDescription */
=======
    /** Authenticator handles its own token caching and permission screen 
      * @hide
      */
    final public boolean customTokens;

    /** A constructor for a full AuthenticatorDescription
     *  @hide 
     */
>>>>>>> 66d46ac61478c967ed45bd1c27b0436654d54299
    public AuthenticatorDescription(String type, String packageName, int labelId, int iconId,
            int smallIconId, int prefId, boolean customTokens) {
        if (type == null) throw new IllegalArgumentException("type cannot be null");
Solution content
    /** The package name that can be used to lookup the resources from above. */
    final public String packageName;

    /** Authenticator handles its own token caching and permission screen */
    final public boolean customTokens;

    /** A constructor for a full AuthenticatorDescription */
    public AuthenticatorDescription(String type, String packageName, int labelId, int iconId,
            int smallIconId, int prefId, boolean customTokens) {
        if (type == null) throw new IllegalArgumentException("type cannot be null");
File
AuthenticatorDescription.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment