Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -41236,10 +41236,12 @@ package android.service.quicksettings { method public android.graphics.drawable.Icon getIcon(); method public java.lang.CharSequence getLabel(); method public int getState(); method public java.lang.CharSequence getSubtitle(); method public void setContentDescription(java.lang.CharSequence); method public void setIcon(android.graphics.drawable.Icon); method public void setLabel(java.lang.CharSequence); method public void setState(int); method public void setSubtitle(java.lang.CharSequence); method public void updateTile(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.quicksettings.Tile> CREATOR; core/java/android/service/quicksettings/Tile.java +20 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.service.quicksettings; import android.annotation.Nullable; import android.graphics.drawable.Icon; import android.os.IBinder; import android.os.Parcel; Loading Loading @@ -62,6 +63,7 @@ public final class Tile implements Parcelable { private IBinder mToken; private Icon mIcon; private CharSequence mLabel; private CharSequence mSubtitle; private CharSequence mContentDescription; // Default to active until clients of the new API can update. private int mState = STATE_ACTIVE; Loading Loading @@ -151,6 +153,22 @@ public final class Tile implements Parcelable { this.mLabel = label; } /** * Gets the current subtitle for the tile. */ @Nullable public CharSequence getSubtitle() { return mSubtitle; } /** * Set the subtitle for the tile. Will be displayed as the secondary label. * @param subtitle the subtitle to show. */ public void setSubtitle(@Nullable CharSequence subtitle) { this.mSubtitle = subtitle; } /** * Gets the current content description for the tile. */ Loading Loading @@ -195,6 +213,7 @@ public final class Tile implements Parcelable { } dest.writeInt(mState); TextUtils.writeToParcel(mLabel, dest, flags); TextUtils.writeToParcel(mSubtitle, dest, flags); TextUtils.writeToParcel(mContentDescription, dest, flags); } Loading @@ -206,6 +225,7 @@ public final class Tile implements Parcelable { } mState = source.readInt(); mLabel = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); mSubtitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); mContentDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); } Loading packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java +9 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,7 @@ public class CustomTile extends QSTileImpl<State> implements TileChangeListener public void updateState(Tile tile) { mTile.setIcon(tile.getIcon()); mTile.setLabel(tile.getLabel()); mTile.setSubtitle(tile.getSubtitle()); mTile.setContentDescription(tile.getContentDescription()); mTile.setState(tile.getState()); } Loading Loading @@ -322,6 +323,14 @@ public class CustomTile extends QSTileImpl<State> implements TileChangeListener return null; }; state.label = mTile.getLabel(); CharSequence subtitle = mTile.getSubtitle(); if (subtitle != null && subtitle.length() > 0) { state.secondaryLabel = subtitle; } else { state.secondaryLabel = null; } if (mTile.getContentDescription() != null) { state.contentDescription = mTile.getContentDescription(); } else { Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -41236,10 +41236,12 @@ package android.service.quicksettings { method public android.graphics.drawable.Icon getIcon(); method public java.lang.CharSequence getLabel(); method public int getState(); method public java.lang.CharSequence getSubtitle(); method public void setContentDescription(java.lang.CharSequence); method public void setIcon(android.graphics.drawable.Icon); method public void setLabel(java.lang.CharSequence); method public void setState(int); method public void setSubtitle(java.lang.CharSequence); method public void updateTile(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.quicksettings.Tile> CREATOR;
core/java/android/service/quicksettings/Tile.java +20 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.service.quicksettings; import android.annotation.Nullable; import android.graphics.drawable.Icon; import android.os.IBinder; import android.os.Parcel; Loading Loading @@ -62,6 +63,7 @@ public final class Tile implements Parcelable { private IBinder mToken; private Icon mIcon; private CharSequence mLabel; private CharSequence mSubtitle; private CharSequence mContentDescription; // Default to active until clients of the new API can update. private int mState = STATE_ACTIVE; Loading Loading @@ -151,6 +153,22 @@ public final class Tile implements Parcelable { this.mLabel = label; } /** * Gets the current subtitle for the tile. */ @Nullable public CharSequence getSubtitle() { return mSubtitle; } /** * Set the subtitle for the tile. Will be displayed as the secondary label. * @param subtitle the subtitle to show. */ public void setSubtitle(@Nullable CharSequence subtitle) { this.mSubtitle = subtitle; } /** * Gets the current content description for the tile. */ Loading Loading @@ -195,6 +213,7 @@ public final class Tile implements Parcelable { } dest.writeInt(mState); TextUtils.writeToParcel(mLabel, dest, flags); TextUtils.writeToParcel(mSubtitle, dest, flags); TextUtils.writeToParcel(mContentDescription, dest, flags); } Loading @@ -206,6 +225,7 @@ public final class Tile implements Parcelable { } mState = source.readInt(); mLabel = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); mSubtitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); mContentDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source); } Loading
packages/SystemUI/src/com/android/systemui/qs/external/CustomTile.java +9 −0 Original line number Diff line number Diff line Loading @@ -183,6 +183,7 @@ public class CustomTile extends QSTileImpl<State> implements TileChangeListener public void updateState(Tile tile) { mTile.setIcon(tile.getIcon()); mTile.setLabel(tile.getLabel()); mTile.setSubtitle(tile.getSubtitle()); mTile.setContentDescription(tile.getContentDescription()); mTile.setState(tile.getState()); } Loading Loading @@ -322,6 +323,14 @@ public class CustomTile extends QSTileImpl<State> implements TileChangeListener return null; }; state.label = mTile.getLabel(); CharSequence subtitle = mTile.getSubtitle(); if (subtitle != null && subtitle.length() > 0) { state.secondaryLabel = subtitle; } else { state.secondaryLabel = null; } if (mTile.getContentDescription() != null) { state.contentDescription = mTile.getContentDescription(); } else { Loading