diff options
author | Joe Onorato <joeo@android.com> | 2010-05-29 17:22:51 -0400 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-06-02 14:48:46 -0700 |
commit | 75199e3ddcf7886c8ee5fbf8b486a8c21335bf14 (patch) | |
tree | 42164398a816e20fd0659c32cbbcdc972a4c30a0 /packages | |
parent | b77f53b21c2185ae3ff7c219c384a6db73f8f4e4 (diff) | |
download | frameworks_base-75199e3ddcf7886c8ee5fbf8b486a8c21335bf14.zip frameworks_base-75199e3ddcf7886c8ee5fbf8b486a8c21335bf14.tar.gz frameworks_base-75199e3ddcf7886c8ee5fbf8b486a8c21335bf14.tar.bz2 |
Populate the notifications at startup of SystemUI.apk.
Change-Id: Ie0b3fd9ed4bc9a012791372e6276f0b5908370a5
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java | 1 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java | 23 |
2 files changed, 21 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java index 5a888fd..8256442 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java @@ -25,7 +25,6 @@ import com.android.internal.statusbar.IStatusBar; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIconList; import com.android.internal.statusbar.StatusBarNotification; -import com.android.internal.statusbar.StatusBarNotificationList; /** * This class takes the functions from IStatusBar that come in on diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java index a60a40b..09cec67 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java @@ -24,6 +24,7 @@ import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; +import android.util.Log; import android.util.Slog; import android.view.Gravity; import android.view.View; @@ -36,6 +37,10 @@ import com.android.internal.statusbar.IStatusBar; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.statusbar.StatusBarIconList; +import com.android.internal.statusbar.StatusBarNotification; + +import java.util.Arrays; +import java.util.ArrayList; public abstract class StatusBarService extends Service implements CommandQueue.Callbacks { private static final String TAG = "StatusBarService"; @@ -53,17 +58,19 @@ public abstract class StatusBarService extends Service implements CommandQueue.C public void onCreate() { // Connect in to the status bar manager service StatusBarIconList iconList = new StatusBarIconList(); + ArrayList<IBinder> notificationKeys = new ArrayList<IBinder>(); + ArrayList<StatusBarNotification> notifications = new ArrayList<StatusBarNotification>(); mCommandQueue = new CommandQueue(this, iconList); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); try { - mBarService.registerStatusBar(mCommandQueue, iconList); + mBarService.registerStatusBar(mCommandQueue, iconList, notificationKeys, notifications); } catch (RemoteException ex) { // If the system process isn't there we're doomed anyway. } // Set up the initial icon state - final int N = iconList.size(); + int N = iconList.size(); int viewIndex = 0; for (int i=0; i<N; i++) { StatusBarIcon icon = iconList.getIcon(i); @@ -73,6 +80,18 @@ public abstract class StatusBarService extends Service implements CommandQueue.C } } + // Set up the initial notification state + N = notificationKeys.size(); + Slog.d(TAG, "installing " + N + " initial notifications"); + if (N == notifications.size()) { + for (int i=0; i<N; i++) { + addNotification(notificationKeys.get(i), notifications.get(i)); + } + } else { + Log.wtf(TAG, "Notification list length mismatch: keys=" + N + + " notifications=" + notifications.size()); + } + // Put up the view addStatusBarView(); } |