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

Commit cc1c7500 authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Unify verification timeout across installation types.

A buggy verifier can block installations if e.g. deadlocked in the
broadcast receiver.

Bug: 288461522
Bug: 288320695
Test: presubmit
Change-Id: Id53f1a5bff78d85b9925bd6457038c4216249644
parent ab7b5561
Loading
Loading
Loading
Loading
+3 −16
Original line number Diff line number Diff line
@@ -589,27 +589,14 @@ final class VerifyingSession {
            final PackageVerificationResponse response = new PackageVerificationResponse(
                    verificationCodeAtTimeout, requiredUid);

            if (streaming) {
                // For streaming installations, count verification timeout from the broadcast.
            startVerificationTimeoutCountdown(verificationId, streaming, response,
                    verificationTimeout);
            }

            // Send the intent to the required verification agent, but only start the
            // verification timeout after the target BroadcastReceivers have run.
            mPm.mContext.sendOrderedBroadcastAsUser(requiredIntent, verifierUser,
                    receiverPermission, AppOpsManager.OP_NONE, options.toBundle(),
                    new BroadcastReceiver() {
                        @Override
                        public void onReceive(Context context, Intent intent) {
                            if (!streaming) {
                                // For NON-streaming installations, count verification timeout from
                                // the broadcast was processed by all receivers.
                                startVerificationTimeoutCountdown(verificationId, streaming,
                                        response, verificationTimeout);
                            }
                        }
                    }, null, 0, null, null);
                    null, null, 0, null, null);
        }

        Trace.asyncTraceBegin(TRACE_TAG_PACKAGE_MANAGER, "verification", verificationId);