diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java')
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 5b911c1..b164468 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -315,9 +315,9 @@ public abstract class BaseStatusBar extends SystemUI implements protected View updateNotificationVetoButton(View row, StatusBarNotification n) { View vetoButton = row.findViewById(R.id.veto); if (n.isClearable()) { - final String _pkg = n.pkg; - final String _tag = n.tag; - final int _id = n.id; + final String _pkg = n.getPkg(); + final String _tag = n.getTag(); + final int _id = n.getId(); vetoButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Accessibility feedback @@ -341,14 +341,14 @@ public abstract class BaseStatusBar extends SystemUI implements protected void applyLegacyRowBackground(StatusBarNotification sbn, View content) { - if (sbn.notification.contentView.getLayoutId() != + if (sbn.getNotification().contentView.getLayoutId() != com.android.internal.R.layout.notification_template_base) { int version = 0; try { - ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.pkg, 0); + ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.getPkg(), 0); version = info.targetSdkVersion; } catch (NameNotFoundException ex) { - Slog.e(TAG, "Failed looking up ApplicationInfo for " + sbn.pkg, ex); + Slog.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPkg(), ex); } if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) { content.setBackgroundResource(R.drawable.notification_row_legacy_bg); @@ -729,8 +729,8 @@ public abstract class BaseStatusBar extends SystemUI implements int maxHeight = mContext.getResources().getDimensionPixelSize(R.dimen.notification_max_height); StatusBarNotification sbn = entry.notification; - RemoteViews oneU = sbn.notification.contentView; - RemoteViews large = sbn.notification.bigContentView; + RemoteViews oneU = sbn.getNotification().contentView; + RemoteViews large = sbn.getNotification().bigContentView; if (oneU == null) { return false; } @@ -741,7 +741,7 @@ public abstract class BaseStatusBar extends SystemUI implements View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false); // for blaming (see SwipeHelper.setLongPressListener) - row.setTag(sbn.pkg); + row.setTag(sbn.getPkg()); workAroundBadLayerDrawableOpacity(row); View vetoButton = updateNotificationVetoButton(row, sbn); @@ -756,10 +756,10 @@ public abstract class BaseStatusBar extends SystemUI implements content.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS); - PendingIntent contentIntent = sbn.notification.contentIntent; + PendingIntent contentIntent = sbn.getNotification().contentIntent; if (contentIntent != null) { final View.OnClickListener listener = new NotificationClicker(contentIntent, - sbn.pkg, sbn.tag, sbn.id); + sbn.getPkg(), sbn.getTag(), sbn.getId()); content.setOnClickListener(listener); } else { content.setOnClickListener(null); @@ -775,7 +775,7 @@ public abstract class BaseStatusBar extends SystemUI implements } } catch (RuntimeException e) { - final String ident = sbn.pkg + "/0x" + Integer.toHexString(sbn.id); + final String ident = sbn.getPkg() + "/0x" + Integer.toHexString(sbn.getId()); Slog.e(TAG, "couldn't inflate view for notification " + ident, e); return false; } @@ -904,7 +904,7 @@ public abstract class BaseStatusBar extends SystemUI implements void handleNotificationError(IBinder key, StatusBarNotification n, String message) { removeNotification(key); try { - mBarService.onNotificationError(n.pkg, n.tag, n.id, n.uid, n.initialPid, message); + mBarService.onNotificationError(n.getPkg(), n.getTag(), n.getId(), n.getUid(), n.getInitialPid(), message); } catch (RemoteException ex) { // The end is nigh. } @@ -932,16 +932,16 @@ public abstract class BaseStatusBar extends SystemUI implements } // Construct the icon. final StatusBarIconView iconView = new StatusBarIconView(mContext, - notification.pkg + "/0x" + Integer.toHexString(notification.id), - notification.notification); + notification.getPkg() + "/0x" + Integer.toHexString(notification.getId()), + notification.getNotification()); iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); - final StatusBarIcon ic = new StatusBarIcon(notification.pkg, - notification.user, - notification.notification.icon, - notification.notification.iconLevel, - notification.notification.number, - notification.notification.tickerText); + final StatusBarIcon ic = new StatusBarIcon(notification.getPkg(), + notification.getUser(), + notification.getNotification().icon, + notification.getNotification().iconLevel, + notification.getNotification().number, + notification.getNotification().tickerText); if (!iconView.set(ic)) { handleNotificationError(key, notification, "Couldn't create icon: " + ic); return null; @@ -1026,19 +1026,19 @@ public abstract class BaseStatusBar extends SystemUI implements final StatusBarNotification oldNotification = oldEntry.notification; // XXX: modify when we do something more intelligent with the two content views - final RemoteViews oldContentView = oldNotification.notification.contentView; - final RemoteViews contentView = notification.notification.contentView; - final RemoteViews oldBigContentView = oldNotification.notification.bigContentView; - final RemoteViews bigContentView = notification.notification.bigContentView; + final RemoteViews oldContentView = oldNotification.getNotification().contentView; + final RemoteViews contentView = notification.getNotification().contentView; + final RemoteViews oldBigContentView = oldNotification.getNotification().bigContentView; + final RemoteViews bigContentView = notification.getNotification().bigContentView; if (DEBUG) { - Slog.d(TAG, "old notification: when=" + oldNotification.notification.when + Slog.d(TAG, "old notification: when=" + oldNotification.getNotification().when + " ongoing=" + oldNotification.isOngoing() + " expanded=" + oldEntry.expanded + " contentView=" + oldContentView + " bigContentView=" + oldBigContentView + " rowParent=" + oldEntry.row.getParent()); - Slog.d(TAG, "new notification: when=" + notification.notification.when + Slog.d(TAG, "new notification: when=" + notification.getNotification().when + " ongoing=" + oldNotification.isOngoing() + " contentView=" + contentView + " bigContentView=" + bigContentView); @@ -1062,13 +1062,13 @@ public abstract class BaseStatusBar extends SystemUI implements && oldBigContentView.getPackage().equals(bigContentView.getPackage()) && oldBigContentView.getLayoutId() == bigContentView.getLayoutId()); ViewGroup rowParent = (ViewGroup) oldEntry.row.getParent(); - boolean orderUnchanged = notification.notification.when==oldNotification.notification.when - && notification.score == oldNotification.score; + boolean orderUnchanged = notification.getNotification().when== oldNotification.getNotification().when + && notification.getScore() == oldNotification.getScore(); // score now encompasses/supersedes isOngoing() - boolean updateTicker = notification.notification.tickerText != null - && !TextUtils.equals(notification.notification.tickerText, - oldEntry.notification.notification.tickerText); + boolean updateTicker = notification.getNotification().tickerText != null + && !TextUtils.equals(notification.getNotification().tickerText, + oldEntry.notification.getNotification().tickerText); boolean isTopAnyway = isTopNotification(rowParent, oldEntry); if (contentsUnchanged && bigContentsUnchanged && (orderUnchanged || isTopAnyway)) { if (DEBUG) Slog.d(TAG, "reusing notification for key: " + key); @@ -1080,20 +1080,20 @@ public abstract class BaseStatusBar extends SystemUI implements bigContentView.reapply(mContext, oldEntry.getLargeView(), mOnClickHandler); } // update the contentIntent - final PendingIntent contentIntent = notification.notification.contentIntent; + final PendingIntent contentIntent = notification.getNotification().contentIntent; if (contentIntent != null) { final View.OnClickListener listener = makeClicker(contentIntent, - notification.pkg, notification.tag, notification.id); + notification.getPkg(), notification.getTag(), notification.getId()); oldEntry.content.setOnClickListener(listener); } else { oldEntry.content.setOnClickListener(null); } // Update the icon. - final StatusBarIcon ic = new StatusBarIcon(notification.pkg, - notification.user, - notification.notification.icon, notification.notification.iconLevel, - notification.notification.number, - notification.notification.tickerText); + final StatusBarIcon ic = new StatusBarIcon(notification.getPkg(), + notification.getUser(), + notification.getNotification().icon, notification.getNotification().iconLevel, + notification.getNotification().number, + notification.getNotification().tickerText); if (!oldEntry.icon.set(ic)) { handleNotificationError(key, notification, "Couldn't update icon: " + ic); return; @@ -1144,7 +1144,7 @@ public abstract class BaseStatusBar extends SystemUI implements if (DEBUG) Slog.d(TAG, "updating the current intruder:" + notification); // XXX: this is a hack for Alarms. The real implementation will need to *update* // the intruder. - if (notification.notification.fullScreenIntent == null) { // TODO(dsandler): consistent logic with add() + if (notification.getNotification().fullScreenIntent == null) { // TODO(dsandler): consistent logic with add() if (DEBUG) Slog.d(TAG, "no longer intrudes!"); mHandler.sendEmptyMessage(MSG_HIDE_INTRUDER); } @@ -1155,9 +1155,9 @@ public abstract class BaseStatusBar extends SystemUI implements // A: Almost none! Only things coming from the system (package is "android") that also // have special "kind" tags marking them as relevant for setup (see below). protected boolean showNotificationEvenIfUnprovisioned(StatusBarNotification sbn) { - if ("android".equals(sbn.pkg)) { - if (sbn.notification.kind != null) { - for (String aKind : sbn.notification.kind) { + if ("android".equals(sbn.getPkg())) { + if (sbn.getNotification().kind != null) { + for (String aKind : sbn.getNotification().kind) { // IME switcher, created by InputMethodManagerService if ("android.system.imeswitcher".equals(aKind)) return true; // OTA availability & errors, created by SystemUpdateService |
