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

Commit 473eaf18 authored by Cheuksan Wang's avatar Cheuksan Wang
Browse files

Clear calling entity before deleting SMS from raw table.

Deletion needs permissions of the phone process.

BUG: 18672706
Change-Id: If70b69745f5b09c644720ba019b409a82efb8033
parent cf924dde
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1156,9 +1156,14 @@ public abstract class InboundSmsHandler extends StateMachine {
                        mSmsFilter.mDestPort, mSmsFilter.mSmsBroadcastReceiver);
            } else {
                // Drop this SMS.
                log("SMS filtered");
                final long token = Binder.clearCallingIdentity();
                try {
                    // Needs phone package permissions.
                    deleteFromRawTable(mSmsFilter.mSmsBroadcastReceiver.mDeleteWhere,
                            mSmsFilter.mSmsBroadcastReceiver.mDeleteWhereArgs);
                } finally {
                    Binder.restoreCallingIdentity(token);
                }
                sendMessage(EVENT_BROADCAST_COMPLETE);
            }
        }