Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 914dcfd0 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android Git Automerger
Browse files

am ca12d755: am 027f84c3: Merge "API: getPkg() -> getPackageName()" into jb-mr2-dev

* commit 'ca12d755':
  API: getPkg() -> getPackageName()
parents 06cacff6 ca12d755
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ public class StatusBarNotification implements Parcelable {
    }

    /** The package of the app that posted the notification. */
    public String getPkg() {
    public String getPackageName() {
        return pkg;
    }

+12 −12
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ 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.getPkg();
            final String _pkg = n.getPackageName();
            final String _tag = n.getTag();
            final int _id = n.getId();
            vetoButton.setOnClickListener(new View.OnClickListener() {
@@ -345,10 +345,10 @@ public abstract class BaseStatusBar extends SystemUI implements
                com.android.internal.R.layout.notification_template_base) {
            int version = 0;
            try {
                ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.getPkg(), 0);
                ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(sbn.getPackageName(), 0);
                version = info.targetSdkVersion;
            } catch (NameNotFoundException ex) {
                Slog.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPkg(), ex);
                Slog.e(TAG, "Failed looking up ApplicationInfo for " + sbn.getPackageName(), ex);
            }
            if (version > 0 && version < Build.VERSION_CODES.GINGERBREAD) {
                content.setBackgroundResource(R.drawable.notification_row_legacy_bg);
@@ -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.getPkg());
        row.setTag(sbn.getPackageName());

        workAroundBadLayerDrawableOpacity(row);
        View vetoButton = updateNotificationVetoButton(row, sbn);
@@ -759,7 +759,7 @@ public abstract class BaseStatusBar extends SystemUI implements
        PendingIntent contentIntent = sbn.getNotification().contentIntent;
        if (contentIntent != null) {
            final View.OnClickListener listener = new NotificationClicker(contentIntent,
                    sbn.getPkg(), sbn.getTag(), sbn.getId());
                    sbn.getPackageName(), 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.getPkg() + "/0x" + Integer.toHexString(sbn.getId());
            final String ident = sbn.getPackageName() + "/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.getPkg(), n.getTag(), n.getId(), n.getUid(), n.getInitialPid(), message);
            mBarService.onNotificationError(n.getPackageName(), n.getTag(), n.getId(), n.getUid(), n.getInitialPid(), message);
        } catch (RemoteException ex) {
            // The end is nigh.
        }
@@ -932,11 +932,11 @@ public abstract class BaseStatusBar extends SystemUI implements
        }
        // Construct the icon.
        final StatusBarIconView iconView = new StatusBarIconView(mContext,
                notification.getPkg() + "/0x" + Integer.toHexString(notification.getId()),
                notification.getPackageName() + "/0x" + Integer.toHexString(notification.getId()),
                notification.getNotification());
        iconView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);

        final StatusBarIcon ic = new StatusBarIcon(notification.getPkg(),
        final StatusBarIcon ic = new StatusBarIcon(notification.getPackageName(),
                notification.getUser(),
                    notification.getNotification().icon,
                    notification.getNotification().iconLevel,
@@ -1083,13 +1083,13 @@ public abstract class BaseStatusBar extends SystemUI implements
                final PendingIntent contentIntent = notification.getNotification().contentIntent;
                if (contentIntent != null) {
                    final View.OnClickListener listener = makeClicker(contentIntent,
                            notification.getPkg(), notification.getTag(), notification.getId());
                            notification.getPackageName(), notification.getTag(), notification.getId());
                    oldEntry.content.setOnClickListener(listener);
                } else {
                    oldEntry.content.setOnClickListener(null);
                }
                // Update the icon.
                final StatusBarIcon ic = new StatusBarIcon(notification.getPkg(),
                final StatusBarIcon ic = new StatusBarIcon(notification.getPackageName(),
                        notification.getUser(),
                        notification.getNotification().icon, notification.getNotification().iconLevel,
                        notification.getNotification().number,
@@ -1155,7 +1155,7 @@ 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.getPkg())) {
        if ("android".equals(sbn.getPackageName())) {
            if (sbn.getNotification().kind != null) {
                for (String aKind : sbn.getNotification().kind) {
                    // IME switcher, created by InputMethodManagerService
+2 −2
Original line number Diff line number Diff line
@@ -2117,7 +2117,7 @@ public class PhoneStatusBar extends BaseStatusBar {
                    NotificationData.Entry e = mNotificationData.get(i);
                    pw.println("    [" + i + "] key=" + e.key + " icon=" + e.icon);
                    StatusBarNotification n = e.notification;
                    pw.println("         pkg=" + n.getPkg() + " id=" + n.getId() + " score=" + n.getScore());
                    pw.println("         pkg=" + n.getPackageName() + " id=" + n.getId() + " score=" + n.getScore());
                    pw.println("         notification=" + n.getNotification());
                    pw.println("         tickerText=\"" + n.getNotification().tickerText + "\"");
                }
@@ -2420,7 +2420,7 @@ public class PhoneStatusBar extends BaseStatusBar {

        try {
            mBarService.onNotificationClear(
                    mCurrentlyIntrudingNotification.getPkg(),
                    mCurrentlyIntrudingNotification.getPackageName(),
                    mCurrentlyIntrudingNotification.getTag(),
                    mCurrentlyIntrudingNotification.getId());
        } catch (android.os.RemoteException ex) {
+4 −4
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ public abstract class Ticker {
        // a notification storm).
        if (initialCount > 0) {
            final Segment seg = mSegments.get(0);
            if (n.getPkg().equals(seg.notification.getPkg())
            if (n.getPackageName().equals(seg.notification.getPackageName())
                    && n.getNotification().icon == seg.notification.getNotification().icon
                    && n.getNotification().iconLevel == seg.notification.getNotification().iconLevel
                    && CharSequences.equals(seg.notification.getNotification().tickerText,
@@ -199,7 +199,7 @@ public abstract class Ticker {
        }

        final Drawable icon = StatusBarIconView.getIcon(mContext,
                new StatusBarIcon(n.getPkg(), n.getUser(), n.getNotification().icon, n.getNotification().iconLevel, 0,
                new StatusBarIcon(n.getPackageName(), n.getUser(), n.getNotification().icon, n.getNotification().iconLevel, 0,
                        n.getNotification().tickerText));
        final CharSequence text = n.getNotification().tickerText;
        final Segment newSegment = new Segment(n, icon, text);
@@ -207,7 +207,7 @@ public abstract class Ticker {
        // If there's already a notification schedule for this package and id, remove it.
        for (int i=0; i<mSegments.size(); i++) {
            Segment seg = mSegments.get(i);
            if (n.getId() == seg.notification.getId() && n.getPkg().equals(seg.notification.getPkg())) {
            if (n.getId() == seg.notification.getId() && n.getPackageName().equals(seg.notification.getPackageName())) {
                // just update that one to use this new data instead
                mSegments.remove(i--); // restart iteration here
            }
@@ -235,7 +235,7 @@ public abstract class Ticker {
    public void removeEntry(StatusBarNotification n) {
        for (int i=mSegments.size()-1; i>=0; i--) {
            Segment seg = mSegments.get(i);
            if (n.getId() == seg.notification.getId() && n.getPkg().equals(seg.notification.getPkg())) {
            if (n.getId() == seg.notification.getId() && n.getPackageName().equals(seg.notification.getPackageName())) {
                mSegments.remove(i);
            }
        }
+3 −3
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ public class TabletTicker
                exception = e;
            }
            if (expanded == null) {
                final String ident = notification.getPkg()
                final String ident = notification.getPackageName()
                        + "/0x" + Integer.toHexString(notification.getId());
                Slog.e(TAG, "couldn't inflate view for notification " + ident, exception);
                return null;
@@ -286,7 +286,7 @@ public class TabletTicker
        } else if (n.tickerText != null) {
            group = (ViewGroup)inflater.inflate(R.layout.system_bar_ticker_compat, mWindow, false);
            final Drawable icon = StatusBarIconView.getIcon(mContext,
                    new StatusBarIcon(notification.getPkg(), notification.getUser(), n.icon, n.iconLevel, 0,
                    new StatusBarIcon(notification.getPackageName(), notification.getUser(), n.icon, n.iconLevel, 0,
                            n.tickerText));
            ImageView iv = (ImageView)group.findViewById(iconId);
            iv.setImageDrawable(icon);
@@ -318,7 +318,7 @@ public class TabletTicker
                // create the usual notification clicker, but chain it together with a halt() call
                // to abort the ticker too
                final View.OnClickListener clicker = mBar.makeClicker(contentIntent,
                        notification.getPkg(), notification.getTag(), notification.getId());
                        notification.getPackageName(), notification.getTag(), notification.getId());
                group.setOnClickListener(new View.OnClickListener() {
                    public void onClick(View v) {
                        halt();
Loading