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

Commit be81b0ce authored by Derek Tan's avatar Derek Tan
Browse files

Prevent any app except LPA to create logical channel to AID of ISD-R.

Bug: 33077154
Test: manual verification using LPA and other app to open logical
      channel to ISD-R separately.
Change-Id: If5c6d05a4d6def1fcaa6af34f3cebf462a7c7220
parent 2d56a524
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -155,6 +155,20 @@ public class EuiccConnector extends StateMachine implements ServiceConnection {
        return bestComponent;
    }

    /**
     * Return the component info of the EuiccService to bind to, or null if none were found.
     */
    public static ComponentInfo findBestComponent(PackageManager packageManager) {
        Intent intent = new Intent(EuiccService.EUICC_SERVICE_INTERFACE);
        List<ResolveInfo> resolveInfoList =
                packageManager.queryIntentServices(intent, EUICC_QUERY_FLAGS);
        ComponentInfo bestComponent = findBestComponent(packageManager, resolveInfoList);
        if (bestComponent == null) {
            Log.w(TAG, "No valid EuiccService implementation found");
        }
        return bestComponent;
    }

    /** Base class for all command callbacks. */
    @VisibleForTesting(visibility = PACKAGE)
    public interface BaseEuiccCommandCallback {
@@ -844,13 +858,7 @@ public class EuiccConnector extends StateMachine implements ServiceConnection {
    /** Return the service info of the EuiccService to bind to, or null if none were found. */
    @Nullable
    private ServiceInfo findBestComponent() {
        Intent intent = new Intent(EuiccService.EUICC_SERVICE_INTERFACE);
        List<ResolveInfo> resolveInfoList = mPm.queryIntentServices(intent, EUICC_QUERY_FLAGS);
        ServiceInfo bestComponent = (ServiceInfo) findBestComponent(mPm, resolveInfoList);
        if (bestComponent == null) {
            Log.w(TAG, "No valid EuiccService implementation found");
        }
        return bestComponent;
        return (ServiceInfo) findBestComponent(mPm);
    }

    /**