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

Commit cd82336d authored by Edgar Wang's avatar Edgar Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix Security crash when the caller is not allowed." into main

parents 4b194d8a 2e7839d0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ open class SearchFeatureProviderImpl : SearchFeatureProvider {
            return
        }
        throw SecurityException(
            "Search result intents must be called with from an allowlisted package.")
            "Search result intents must be called with from an allowlisted package: $callerPackage"
        )
    }

    override fun getSearchIndexableResources(): SearchIndexableResources =
+8 −3
Original line number Diff line number Diff line
@@ -54,9 +54,14 @@ public class SearchResultTrampoline extends Activity {

        final String callerPackage = getLaunchedFromPackage();
        // First make sure caller has privilege to launch a search result page.
        try {
            FeatureFactory.getFeatureFactory()
                    .getSearchFeatureProvider()
                    .verifyLaunchSearchResultPageCaller(this, callerPackage);
        } catch (SecurityException e) {
            finish();
            return;
        }
        // Didn't crash, proceed and launch the result as a subsetting.
        Intent intent = getIntent();
        final String highlightMenuKey = intent.getStringExtra(