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

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

Merge "contexthub: handle unsupported V4 at top level" into main

parents ea44ee04 033c2503
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -144,23 +144,22 @@ class HubInfoRegistry implements ContextHubHalEndpointCallback.IEndpointLifecycl
    /** Wakelock held while endpoint callbacks are being invoked */
    private final WakeLock mWakeLock;

    /**
     * Constructs and initializes this class.
     *
     * @throws InstantiationException on unexpected failure
     */
    HubInfoRegistry(Context context, IContextHubWrapper contextHubWrapper)
            throws InstantiationException {
        mContextHubWrapper = contextHubWrapper;
        try {
        refreshCachedHubs();
        refreshCachedEndpoints();
        } catch (UnsupportedOperationException e) {
            String error = "Failed to update hub and endpoint cache";
            Log.e(TAG, error, e);
            throw new InstantiationException(error);
        }

        PowerManager powerManager = context.getSystemService(PowerManager.class);
        if (powerManager == null) {
            String error = "PowerManager was null";
            Log.e(TAG, error);
            throw new InstantiationError(error);
            throw new InstantiationException(error);
        }
        mWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TAG);
        mWakeLock.setWorkSource(new WorkSource(Process.myUid(), context.getPackageName()));