Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c298a851 authored by Fred Quintana's avatar Fred Quintana
Browse files

add an accessor for Context for use by subclasses

parent 1005569f
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.pm.RegisteredServicesCache;
import android.content.res.TypedArray;
import android.content.res.TypedArray;
import android.content.Context;
import android.content.Context;
import android.util.AttributeSet;
import android.util.AttributeSet;
import android.text.TextUtils;


/**
/**
 * A cache of services that export the {@link IAccountAuthenticator} interface. This cache
 * A cache of services that export the {@link IAccountAuthenticator} interface. This cache
@@ -48,6 +49,9 @@ import android.util.AttributeSet;
                    com.android.internal.R.styleable.AccountAuthenticator_label, 0);
                    com.android.internal.R.styleable.AccountAuthenticator_label, 0);
            final int iconId = sa.getResourceId(
            final int iconId = sa.getResourceId(
                    com.android.internal.R.styleable.AccountAuthenticator_icon, 0);
                    com.android.internal.R.styleable.AccountAuthenticator_icon, 0);
            if (TextUtils.isEmpty(accountType)) {
                return null;
            }
            return new AuthenticatorDescription(accountType, packageName, labelId, iconId);
            return new AuthenticatorDescription(accountType, packageName, labelId, iconId);
        } finally {
        } finally {
            sa.recycle();
            sa.recycle();
+3 −0
Original line number Original line Diff line number Diff line
@@ -10,6 +10,8 @@ public class AuthenticatorDescription implements Parcelable {
    final public String packageName;
    final public String packageName;


    public AuthenticatorDescription(String type, String packageName, int labelId, int iconId) {
    public AuthenticatorDescription(String type, String packageName, int labelId, int iconId) {
        if (type == null) throw new IllegalArgumentException("type cannot be null");
        if (packageName == null) throw new IllegalArgumentException("packageName cannot be null");
        this.type = type;
        this.type = type;
        this.packageName = packageName;
        this.packageName = packageName;
        this.labelId = labelId;
        this.labelId = labelId;
@@ -17,6 +19,7 @@ public class AuthenticatorDescription implements Parcelable {
    }
    }


    public static AuthenticatorDescription newKey(String type) {
    public static AuthenticatorDescription newKey(String type) {
        if (type == null) throw new IllegalArgumentException("type cannot be null");
        return new AuthenticatorDescription(type);
        return new AuthenticatorDescription(type);
    }
    }


+4 −0
Original line number Original line Diff line number Diff line
@@ -64,6 +64,10 @@ public abstract class AbstractThreadedSyncAdapter {
        mAutoInitialize = autoInitialize;
        mAutoInitialize = autoInitialize;
    }
    }


    public Context getContext() {
        return mContext;
    }

    class ISyncAdapterImpl extends ISyncAdapter.Stub {
    class ISyncAdapterImpl extends ISyncAdapter.Stub {
        public void startSync(ISyncContext syncContext, String authority, Account account,
        public void startSync(ISyncContext syncContext, String authority, Account account,
                Bundle extras) {
                Bundle extras) {