am 38a1081c: Merge change 24514 into eclair

Merge commit '38a1081cad9385073d80d358decf04f6b2fd5723' into eclair-plus-aosp

* commit '38a1081cad9385073d80d358decf04f6b2fd5723':
  Add smallIcon and accountPreferences references to AuthenticatorDescription. Update after path conflict.
This commit is contained in:
Jim Miller
2009-09-10 18:19:29 -07:00
committed by Android Git Automerger
6 changed files with 73 additions and 3 deletions

View File

@@ -1659,6 +1659,17 @@
visibility="public" visibility="public"
> >
</field> </field>
<field name="accountPreferences"
type="int"
transient="false"
volatile="false"
value="16843423"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="accountType" <field name="accountType"
type="int" type="int"
transient="false" transient="false"
@@ -7093,6 +7104,17 @@
visibility="public" visibility="public"
> >
</field> </field>
<field name="smallIcon"
type="int"
transient="false"
volatile="false"
value="16843422"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="smallScreens" <field name="smallScreens"
type="int" type="int"
transient="false" transient="false"
@@ -14543,6 +14565,10 @@
</parameter> </parameter>
<parameter name="iconId" type="int"> <parameter name="iconId" type="int">
</parameter> </parameter>
<parameter name="smallIconId" type="int">
</parameter>
<parameter name="prefId" type="int">
</parameter>
</constructor> </constructor>
<method name="describeContents" <method name="describeContents"
return="int" return="int"
@@ -14593,6 +14619,16 @@
visibility="public" visibility="public"
> >
</field> </field>
<field name="accountPreferencesId"
type="int"
transient="false"
volatile="false"
static="false"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="iconId" <field name="iconId"
type="int" type="int"
transient="false" transient="false"
@@ -14623,6 +14659,16 @@
visibility="public" visibility="public"
> >
</field> </field>
<field name="smallIconId"
type="int"
transient="false"
volatile="false"
static="false"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="type" <field name="type"
type="java.lang.String" type="java.lang.String"
transient="false" transient="false"

View File

@@ -49,10 +49,15 @@ import android.text.TextUtils;
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);
final int smallIconId = sa.getResourceId(
com.android.internal.R.styleable.AccountAuthenticator_smallIcon, 0);
final int prefId = sa.getResourceId(
com.android.internal.R.styleable.AccountAuthenticator_accountPreferences, 0);
if (TextUtils.isEmpty(accountType)) { if (TextUtils.isEmpty(accountType)) {
return null; return null;
} }
return new AuthenticatorDescription(accountType, packageName, labelId, iconId); return new AuthenticatorDescription(accountType, packageName, labelId, iconId,
smallIconId, prefId);
} finally { } finally {
sa.recycle(); sa.recycle();
} }

View File

@@ -7,15 +7,20 @@ public class AuthenticatorDescription implements Parcelable {
final public String type; final public String type;
final public int labelId; final public int labelId;
final public int iconId; final public int iconId;
final public int smallIconId;
final public int accountPreferencesId;
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,
int smallIconId, int prefId) {
if (type == null) throw new IllegalArgumentException("type cannot be null"); if (type == null) throw new IllegalArgumentException("type cannot be null");
if (packageName == null) throw new IllegalArgumentException("packageName 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;
this.iconId = iconId; this.iconId = iconId;
this.smallIconId = smallIconId;
this.accountPreferencesId = prefId;
} }
public static AuthenticatorDescription newKey(String type) { public static AuthenticatorDescription newKey(String type) {
@@ -28,6 +33,8 @@ public class AuthenticatorDescription implements Parcelable {
this.packageName = null; this.packageName = null;
this.labelId = 0; this.labelId = 0;
this.iconId = 0; this.iconId = 0;
this.smallIconId = 0;
this.accountPreferencesId = 0;
} }
private AuthenticatorDescription(Parcel source) { private AuthenticatorDescription(Parcel source) {
@@ -35,6 +42,8 @@ public class AuthenticatorDescription implements Parcelable {
this.packageName = source.readString(); this.packageName = source.readString();
this.labelId = source.readInt(); this.labelId = source.readInt();
this.iconId = source.readInt(); this.iconId = source.readInt();
this.smallIconId = source.readInt();
this.accountPreferencesId = source.readInt();
} }
public int describeContents() { public int describeContents() {
@@ -57,6 +66,8 @@ public class AuthenticatorDescription implements Parcelable {
dest.writeString(packageName); dest.writeString(packageName);
dest.writeInt(labelId); dest.writeInt(labelId);
dest.writeInt(iconId); dest.writeInt(iconId);
dest.writeInt(smallIconId);
dest.writeInt(accountPreferencesId);
} }
public static final Creator<AuthenticatorDescription> CREATOR = public static final Creator<AuthenticatorDescription> CREATOR =

View File

@@ -3438,6 +3438,10 @@
<attr name="label"/> <attr name="label"/>
<!-- the icon of the authenticator. --> <!-- the icon of the authenticator. -->
<attr name="icon"/> <attr name="icon"/>
<!-- smaller icon of the authenticator -->
<attr name="smallIcon" format="reference"/>
<!-- a preferences.xml file for authenticator-specific settings -->
<attr name="accountPreferences" format="reference"/>
</declare-styleable> </declare-styleable>
<!-- =============================== --> <!-- =============================== -->

View File

@@ -65,4 +65,6 @@
<item type="id" name="startSelectingText" /> <item type="id" name="startSelectingText" />
<item type="id" name="stopSelectingText" /> <item type="id" name="stopSelectingText" />
<item type="id" name="addToDictionary" /> <item type="id" name="addToDictionary" />
<item type="id" name="accountPreferences" />
<item type="id" name="smallIcon" />
</resources> </resources>

View File

@@ -1162,6 +1162,8 @@
<public type="attr" name="supportsUploading" /> <public type="attr" name="supportsUploading" />
<public type="attr" name="killAfterRestore" /> <public type="attr" name="killAfterRestore" />
<public type="attr" name="restoreNeedsApplication" /> <public type="attr" name="restoreNeedsApplication" />
<public type="attr" name="smallIcon" />
<public type="attr" name="accountPreferences" />
<public type="style" name="Theme.Wallpaper" /> <public type="style" name="Theme.Wallpaper" />
<public type="style" name="Theme.Wallpaper.NoTitleBar" /> <public type="style" name="Theme.Wallpaper.NoTitleBar" />