1818
1919import android .os .Parcel ;
2020import android .os .Parcelable ;
21+ import android .os .UserHandle ;
2122
2223public class StatusBarIcon implements Parcelable {
2324 public String iconPackage ;
25+ public UserHandle user ;
2426 public int iconId ;
2527 public int iconLevel ;
2628 public boolean visible = true ;
2729 public int number ;
2830 public CharSequence contentDescription ;
2931
30- public StatusBarIcon (String iconPackage , int iconId , int iconLevel , int number ,
32+ public StatusBarIcon (String iconPackage , UserHandle user , int iconId , int iconLevel , int number ,
3133 CharSequence contentDescription ) {
3234 this .iconPackage = iconPackage ;
35+ this .user = user ;
3336 this .iconId = iconId ;
3437 this .iconLevel = iconLevel ;
3538 this .number = number ;
@@ -38,15 +41,16 @@ public StatusBarIcon(String iconPackage, int iconId, int iconLevel, int number,
3841
3942 @ Override
4043 public String toString () {
41- return "StatusBarIcon(pkg=" + this .iconPackage + " id=0x" + Integer .toHexString (this .iconId )
44+ return "StatusBarIcon(pkg=" + this .iconPackage + "user=" + user .getIdentifier ()
45+ + " id=0x" + Integer .toHexString (this .iconId )
4246 + " level=" + this .iconLevel + " visible=" + visible
4347 + " num=" + this .number + " )" ;
4448 }
4549
4650 @ Override
4751 public StatusBarIcon clone () {
48- StatusBarIcon that = new StatusBarIcon (this .iconPackage , this .iconId , this .iconLevel ,
49- this .number , this .contentDescription );
52+ StatusBarIcon that = new StatusBarIcon (this .iconPackage , this .user , this .iconId ,
53+ this .iconLevel , this . number , this .contentDescription );
5054 that .visible = this .visible ;
5155 return that ;
5256 }
@@ -60,6 +64,7 @@ public StatusBarIcon(Parcel in) {
6064
6165 public void readFromParcel (Parcel in ) {
6266 this .iconPackage = in .readString ();
67+ this .user = (UserHandle ) in .readParcelable (null );
6368 this .iconId = in .readInt ();
6469 this .iconLevel = in .readInt ();
6570 this .visible = in .readInt () != 0 ;
@@ -69,6 +74,7 @@ public void readFromParcel(Parcel in) {
6974
7075 public void writeToParcel (Parcel out , int flags ) {
7176 out .writeString (this .iconPackage );
77+ out .writeParcelable (this .user , 0 );
7278 out .writeInt (this .iconId );
7379 out .writeInt (this .iconLevel );
7480 out .writeInt (this .visible ? 1 : 0 );
0 commit comments