Merge "If an icon add remove get coalesced, don't remove some other icon." into gingerbread

This commit is contained in:
Joe Onorato
2010-09-27 11:40:15 -07:00
committed by Android (Google) Code Review
3 changed files with 26 additions and 3 deletions

View File

@@ -165,8 +165,10 @@ class CommandQueue extends IStatusBar.Stub {
break; break;
} }
case OP_REMOVE_ICON: case OP_REMOVE_ICON:
mList.removeIcon(index); if (mList.getIcon(index) != null) {
mCallbacks.removeIcon(mList.getSlot(index), index, viewIndex); mList.removeIcon(index);
mCallbacks.removeIcon(mList.getSlot(index), index, viewIndex);
}
break; break;
} }
break; break;

View File

@@ -82,7 +82,7 @@ import com.android.systemui.statusbar.policy.StatusBarPolicy;
public class StatusBarService extends Service implements CommandQueue.Callbacks { public class StatusBarService extends Service implements CommandQueue.Callbacks {
static final String TAG = "StatusBarService"; static final String TAG = "StatusBarService";
static final boolean SPEW_ICONS = true; static final boolean SPEW_ICONS = false;
static final boolean SPEW = false; static final boolean SPEW = false;
public static final String ACTION_STATUSBAR_START public static final String ACTION_STATUSBAR_START

View File

@@ -60,6 +60,27 @@ public class StatusBarTest extends TestActivity
} }
private Test[] mTests = new Test[] { private Test[] mTests = new Test[] {
new Test("Double Remove") {
public void run() {
Log.d(TAG, "set 0");
mStatusBarManager.setIcon("speakerphone", R.drawable.stat_sys_phone, 0);
Log.d(TAG, "remove 1");
mStatusBarManager.removeIcon("tty");
SystemClock.sleep(1000);
Log.d(TAG, "set 1");
mStatusBarManager.setIcon("tty", R.drawable.stat_sys_phone, 0);
if (false) {
Log.d(TAG, "set 2");
mStatusBarManager.setIcon("tty", R.drawable.stat_sys_phone, 0);
}
Log.d(TAG, "remove 2");
mStatusBarManager.removeIcon("tty");
Log.d(TAG, "set 3");
mStatusBarManager.setIcon("speakerphone", R.drawable.stat_sys_phone, 0);
}
},
new Test("Hide") { new Test("Hide") {
public void run() { public void run() {
Window win = getWindow(); Window win = getWindow();