am 66d7d01e: Get icon updating working.
This commit is contained in:
@@ -18,7 +18,7 @@ package com.android.policy.statusbar.phone;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
|
||||
import com.android.internal.statusbar.IStatusBar;
|
||||
import com.android.internal.statusbar.StatusBarIcon;
|
||||
@@ -72,7 +72,7 @@ class CommandQueue extends IStatusBar.Stub {
|
||||
private final class H extends Handler {
|
||||
public void handleMessage(Message msg) {
|
||||
int what = msg.what & MSG_MASK;
|
||||
switch (msg.what) {
|
||||
switch (what) {
|
||||
case MSG_ICON: {
|
||||
int index = msg.what & INDEX_MASK;
|
||||
int viewIndex = mList.getViewIndex(index);
|
||||
|
||||
@@ -39,6 +39,9 @@ public class StatusBarIconView extends AnimatedImageView {
|
||||
}
|
||||
|
||||
private static boolean streq(String a, String b) {
|
||||
if (a == b) {
|
||||
return true;
|
||||
}
|
||||
if (a == null && b != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public abstract class StatusBarService extends Service implements CommandQueue.C
|
||||
public void onCreate() {
|
||||
// Connect in to the status bar manager service
|
||||
StatusBarIconList iconList = new StatusBarIconList();
|
||||
mCommandQueue = new CommandQueue(this, iconList);
|
||||
mBarService = IStatusBarService.Stub.asInterface(
|
||||
ServiceManager.getService(Context.STATUS_BAR_SERVICE));
|
||||
try {
|
||||
@@ -66,7 +67,6 @@ public abstract class StatusBarService extends Service implements CommandQueue.C
|
||||
}
|
||||
|
||||
// Set up the initial icon state
|
||||
mCommandQueue = new CommandQueue(this, iconList);
|
||||
final int N = iconList.size();
|
||||
int viewIndex = 0;
|
||||
for (int i=0; i<N; i++) {
|
||||
|
||||
@@ -196,6 +196,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub
|
||||
}
|
||||
|
||||
StatusBarIcon icon = new StatusBarIcon(iconPackage, iconId, iconLevel);
|
||||
//Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon);
|
||||
mIcons.setIcon(index, icon);
|
||||
|
||||
// Tell the client. If it fails, it'll restart soon and we'll sync up.
|
||||
@@ -287,9 +288,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub
|
||||
// ================================================================================
|
||||
// Can be called from any thread
|
||||
// ================================================================================
|
||||
public void setIconVisibility(IBinder key, boolean visible) {
|
||||
addPendingOp(OP_SET_VISIBLE, key, visible);
|
||||
}
|
||||
|
||||
private void addPendingOp(int code, IBinder key, IconData data, NotificationData n, int i) {
|
||||
synchronized (mQueueLock) {
|
||||
|
||||
Reference in New Issue
Block a user