Revise the logic of verifyCallingPackage

Combining the two SecurityException check in verifyCallingPackage
to mitigate the potential information leakage.

Bug: 204082360
Bug: 204082784
Test: atest CtsAppSearchTestCases \
        FrameworksCoreTests:android.app.appsearch \
        FrameworksServicesTests:com.android.server.appsearch \
        CtsAppSearchHostTestCases
Test: manually using the PoC in the buganizer to ensure the symptom
      no longer exists.
Change-Id: I6ccb6be55f948b074b63e99c24908a53bcb7dbcf
1 file changed