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

Commit 3e8a69cd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix typo: decrement not increment"

parents e2c6ce4b d4caf851
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ public class BroadcastDispatcher {
        final Intent intent = r.intent;
        // Any in-flight broadcast has already been popped, and cannot be replaced.
        // (This preserves existing behavior of the replacement API)
        for (int i = list.size() - 1; i >= 0; i++) {
        for (int i = list.size() - 1; i >= 0; i--) {
            old = list.get(i);
            if (old.userId == r.userId && intent.filterEquals(old.intent)) {
                if (DEBUG_BROADCAST) {
+26 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ public class ActivityTestMain extends Activity {
    static final int MSG_SPAM_ALARM = 2;
    static final int MSG_SLOW_RECEIVER = 3;
    static final int MSG_SLOW_ALARM_RECEIVER = 4;
    static final int MSG_REPLACE_BROADCAST = 5;

    final Handler mHandler = new Handler() {
        @Override
@@ -138,6 +139,20 @@ public class ActivityTestMain extends Activity {
                    Log.i(TAG, "Setting alarm for now + 5 seconds");
                    am.setExact(AlarmManager.ELAPSED_REALTIME, now + 5_000, pi);
                } break;
                case MSG_REPLACE_BROADCAST: {
                    Intent intent = new Intent(ActivityTestMain.this, SlowReceiver.class);
                    intent.setAction(SLOW_RECEIVER_ACTION);
                    intent.putExtra(SLOW_RECEIVER_EXTRA, 1);
                    sendOrderedBroadcast(intent, null, mSlowReceiverCompletion, mHandler,
                            Activity.RESULT_OK, null, null);
                    intent.putExtra(SLOW_RECEIVER_EXTRA, 2);
                    sendOrderedBroadcast(intent, null, mSlowReceiverCompletion, mHandler,
                            Activity.RESULT_OK, null, null);
                    intent.putExtra(SLOW_RECEIVER_EXTRA, 5038);
                    intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
                    sendOrderedBroadcast(intent, null, mSlowReceiverCompletion, mHandler,
                            Activity.RESULT_OK, null, null);
                } break;
            }
            super.handleMessage(msg);
        }
@@ -418,6 +433,12 @@ public class ActivityTestMain extends Activity {
                return true;
            }
        });
        menu.add("Replace broadcast").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
            @Override public boolean onMenuItemClick(MenuItem item) {
                scheduleReplaceBroadcast();
                return true;
            }
        });
        menu.add("Stack Doc").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
            @Override public boolean onMenuItemClick(MenuItem item) {
                ActivityManager.AppTask task = findDocTask();
@@ -616,6 +637,11 @@ public class ActivityTestMain extends Activity {
        mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_SLOW_ALARM_RECEIVER), 500);
    }

    void scheduleReplaceBroadcast() {
        mHandler.removeMessages(MSG_REPLACE_BROADCAST);
        mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_REPLACE_BROADCAST), 500);
    }

    private View scrollWrap(View view) {
        ScrollView scroller = new ScrollView(this);
        scroller.addView(view, new ScrollView.LayoutParams(ScrollView.LayoutParams.MATCH_PARENT,