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

Commit 9cbaa81f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Skip error logs when HAL doesn't support new message API" into main

parents e9f9bbf3 a967b764
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -192,9 +192,10 @@ import java.util.function.Consumer;
     * This is separate from the constructor so that this may be passed into the callback registered
     * with the HAL.
     *
     * @throws InstantiationException on any failure
     * @throws InstantiationException on unexpected failure
     * @throws UnsupportedOperationException if not supported by the HAL
     */
    /* package */ void init() throws InstantiationException {
    /* package */ void init() throws InstantiationException, UnsupportedOperationException {
        if (mSessionIdsValid) {
            throw new IllegalStateException("Already initialized");
        }
@@ -214,12 +215,11 @@ import java.util.function.Consumer;
            if (mHubInterface == null) {
                throw new IllegalStateException("Received null IEndpointCommunication");
            }
        } catch (RemoteException | IllegalStateException | ServiceSpecificException
                 | UnsupportedOperationException e) {
        } catch (RemoteException | IllegalStateException | ServiceSpecificException e) {
            String error = "Failed to register ContextHubService as message hub";
            Log.e(TAG, error, e);
            throw new InstantiationException(error);
        }
        }  // Forward UnsupportedOperationException to caller

        int[] range = null;
        try {
+6 −4
Original line number Diff line number Diff line
@@ -342,17 +342,19 @@ public class ContextHubService extends IContextHubService.Stub {
                        new ContextHubEndpointManager(
                                mContext, mContextHubWrapper, registry, mTransactionManager);
                mEndpointManager.init();
                Log.i(TAG, "Enabling generic offload API");
            } catch (InstantiationException e) {
                Log.d(TAG, "Enabling generic offload API");
            } catch (InstantiationException | UnsupportedOperationException e) {
                mEndpointManager = null;
                registry = null;
                Log.w(TAG, "Generic offload API not supported, disabling");
                if (e instanceof UnsupportedOperationException) {
                    Log.d(TAG, "Generic offload API not supported by HAL");
                }
            }
            mHubInfoRegistry = registry;
        } else {
            mHubInfoRegistry = null;
            mEndpointManager = null;
            Log.i(TAG, "Disabling generic offload API");
            Log.d(TAG, "Disabling generic offload API due to flag config");
        }

        initDefaultClientMap();