diff options
Diffstat (limited to 'services/java/com')
-rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 2 | ||||
-rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 8 | ||||
-rw-r--r-- | services/java/com/android/server/StatusBarManagerService.java (renamed from services/java/com/android/server/status/StatusBarManagerService.java) | 65 | ||||
-rw-r--r-- | services/java/com/android/server/SystemServer.java | 1 | ||||
-rw-r--r-- | services/java/com/android/server/status/LatestItemView.java | 34 | ||||
-rwxr-xr-x | services/java/com/android/server/status/package.html | 5 |
6 files changed, 43 insertions, 72 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index a1f26f2..4d35bec 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -26,7 +26,7 @@ import com.android.internal.view.IInputMethodManager; import com.android.internal.view.IInputMethodSession; import com.android.internal.view.InputBindResult; -import com.android.server.status.StatusBarManagerService; +import com.android.server.StatusBarManagerService; import org.xmlpull.v1.XmlPullParserException; diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index b5c2b1b..6f44e8e 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -17,7 +17,7 @@ package com.android.server; import com.android.internal.statusbar.StatusBarNotification; -import com.android.server.status.StatusBarManagerService; +import com.android.server.StatusBarManagerService; import android.app.ActivityManagerNative; import android.app.IActivityManager; @@ -303,6 +303,12 @@ class NotificationManagerService extends INotificationManager.Stub updateLightsLocked(); } } + + public void onNotificationError(String pkg, String tag, int id, String message) { + Slog.d(TAG, "onNotification error pkg=" + pkg + " tag=" + tag + " id=" + id); + cancelNotification(pkg, tag, id, 0, 0); + // TODO: Tell the activity manager. + } }; private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { diff --git a/services/java/com/android/server/status/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java index 0af1ebb..1a16387 100644 --- a/services/java/com/android/server/status/StatusBarManagerService.java +++ b/services/java/com/android/server/StatusBarManagerService.java @@ -14,11 +14,12 @@ * limitations under the License. */ -package com.android.server.status; +package com.android.server; import android.app.PendingIntent; import android.app.StatusBarManager; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -55,9 +56,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub static final String TAG = "StatusBarManagerService"; static final boolean SPEW = true; - public static final String ACTION_STATUSBAR_START - = "com.android.internal.policy.statusbar.START"; - final Context mContext; Handler mHandler = new Handler(); NotificationCallbacks mNotificationCallbacks; @@ -87,6 +85,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub void onClearAll(); void onNotificationClick(String pkg, String tag, int id); void onPanelRevealed(); + void onNotificationError(String pkg, String tag, int id, String message); } /** @@ -96,7 +95,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub mContext = context; final Resources res = context.getResources(); - mIcons.defineSlots(res.getStringArray(com.android.internal.R.array.status_bar_icon_order)); + mIcons.defineSlots(res.getStringArray(com.android.internal.R.array.config_statusBarIcons)); } public void setNotificationCallbacks(NotificationCallbacks listener) { @@ -111,9 +110,12 @@ public class StatusBarManagerService extends IStatusBarService.Stub } public void systemReady2() { - // Start the status bar app - Intent intent = new Intent(ACTION_STATUSBAR_START); - mContext.sendBroadcast(intent /** permission **/); + ComponentName cn = ComponentName.unflattenFromString( + mContext.getString(com.android.internal.R.string.config_statusBarComponent)); + Intent intent = new Intent(); + intent.setComponent(cn); + Slog.i(TAG, "Starting service: " + cn); + mContext.startService(intent); } // ================================================================================ @@ -248,12 +250,19 @@ public class StatusBarManagerService extends IStatusBarService.Stub "StatusBarManagerService"); } + private void enforceStatusBarService() { + mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR_SERVICE, + "StatusBarManagerService"); + } + // ================================================================================ // Callbacks from the status bar service. // ================================================================================ public void registerStatusBar(IStatusBar bar, StatusBarIconList iconList, List<IBinder> notificationKeys, List<StatusBarNotification> notifications) { + enforceStatusBarService(); + Slog.i(TAG, "registerStatusBar bar=" + bar); mBar = bar; synchronized (mIcons) { @@ -268,18 +277,32 @@ public class StatusBarManagerService extends IStatusBarService.Stub } /** - * The status bar service should call this when the user changes whether - * the status bar is visible or not. + * The status bar service should call this each time the user brings the panel from + * invisible to visible in order to clear the notification light. */ - public void visibilityChanged(boolean visible) { - //Slog.d(TAG, "visibilityChanged visible=" + visible); + public void onPanelRevealed() { + enforceStatusBarService(); + + // tell the notification manager to turn off the lights. + mNotificationCallbacks.onPanelRevealed(); } public void onNotificationClick(String pkg, String tag, int id) { + enforceStatusBarService(); + mNotificationCallbacks.onNotificationClick(pkg, tag, id); } + public void onNotificationError(String pkg, String tag, int id, String message) { + enforceStatusBarService(); + + // WARNING: this will call back into us to do the remove. Don't hold any locks. + mNotificationCallbacks.onNotificationError(pkg, tag, id, message); + } + public void onClearAllNotifications() { + enforceStatusBarService(); + mNotificationCallbacks.onClearAll(); } @@ -423,24 +446,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub } } - /** - * The LEDs are turned o)ff when the notification panel is shown, even just a little bit. - * This was added last-minute and is inconsistent with the way the rest of the notifications - * are handled, because the notification isn't really cancelled. The lights are just - * turned off. If any other notifications happen, the lights will turn back on. Steve says - * this is what he wants. (see bug 1131461) - */ - private boolean mPanelSlightlyVisible; - void panelSlightlyVisible(boolean visible) { - if (mPanelSlightlyVisible != visible) { - mPanelSlightlyVisible = visible; - if (visible) { - // tell the notification manager to turn off the lights. - mNotificationCallbacks.onPanelRevealed(); - } - } - } - private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 4307cdc..b91bf73 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -17,7 +17,6 @@ package com.android.server; import com.android.server.am.ActivityManagerService; -import com.android.server.status.StatusBarManagerService; import com.android.internal.os.BinderInternal; import com.android.internal.os.SamplingProfilerIntegration; diff --git a/services/java/com/android/server/status/LatestItemView.java b/services/java/com/android/server/status/LatestItemView.java deleted file mode 100644 index fe8d164..0000000 --- a/services/java/com/android/server/status/LatestItemView.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.server.status; - -import android.content.Context; -import android.util.AttributeSet; -import android.util.Slog; -import android.view.MotionEvent; -import android.widget.FrameLayout; - -public class LatestItemView extends FrameLayout { - - public LatestItemView(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public boolean dispatchTouchEvent(MotionEvent ev) { - return onTouchEvent(ev); - } -} diff --git a/services/java/com/android/server/status/package.html b/services/java/com/android/server/status/package.html deleted file mode 100755 index c9f96a6..0000000 --- a/services/java/com/android/server/status/package.html +++ /dev/null @@ -1,5 +0,0 @@ -<body> - -{@hide} - -</body> |