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

Commit 175884b6 authored by Madhav Iyengar's avatar Madhav Iyengar
Browse files

contexthub: Handle unsupported APIs

Bug: b/378545373
Flag: android.chre.flags.offload_api
Test: presubmit
Change-Id: Ica5e7e1e0aa162b1408a6c860c5856db43519e7a
parent e35d8a93
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -322,8 +322,15 @@ public class ContextHubService extends IContextHubService.Stub {
        }

        if (Flags.offloadApi()) {
            mHubInfoRegistry = new HubInfoRegistry(mContextHubWrapper);
            HubInfoRegistry registry;
            try {
                registry = new HubInfoRegistry(mContextHubWrapper);
                Log.i(TAG, "Enabling generic offload API");
            } catch (UnsupportedOperationException e) {
                registry = null;
                Log.w(TAG, "Generic offload API not supported, disabling");
            }
            mHubInfoRegistry = registry;
        } else {
            mHubInfoRegistry = null;
            Log.i(TAG, "Disabling generic offload API");