Skip to content

fix(phone-app): Huawei Wear Engine package visibility queries and auth permission prompt #40

Description

@hungify

What to build

Fix the persistent "Permission Required" / Unauthorized state when connecting to Huawei Wear Engine on Android 11+ devices.

Root Cause

  1. Missing <queries> in AndroidManifest.xml: Android 11+ (API 30+) enforces package visibility restrictions. Because com.huawei.health and com.huawei.health.action.WEAR_ENGINE_SERVICE are not declared in <queries>, the Wear Engine SDK fails to discover the Huawei Health service (WearEngine_WearEngineClientInner: implicitIntent List are null).
  2. Missing AuthClient.requestPermission flow: HuaweiWearEngineService currently only calls authClient.checkPermission(Permission.DEVICE_MANAGER). It never invokes authClient.requestPermission(...) to trigger the system/Huawei Health authorization dialog on the phone, causing checkPermission to stay permanently false even after tapping "Retry".

Acceptance criteria

  • Add <queries> declaration in AndroidManifest.xml for package com.huawei.health and intent action com.huawei.health.action.WEAR_ENGINE_SERVICE.
  • Implement requestPermission flow in WearEngineService / HuaweiWearEngineService invoking AuthClient.requestPermission(AuthCallback, Permission.DEVICE_MANAGER).
  • Update MainActivity / MainViewModel to trigger the permission request dialog when unauthorized and user taps Connect Watch / Retry.
  • Handle AuthCallback.onOk (transition to checking connection / connected) and AuthCallback.onCancel (inform user with clear retry guidance).
  • Unit tests for HuaweiWearEngineService verifying requestPermission success and failure flows.

Blocked by

  • None (can start immediately)

Activity

  1. hungify commented on Aug 25, 2026

    @hungify
    OwnerAuthor

    Resolved and committed in 9132206: added package visibility queries to AndroidManifest.xml and implemented AuthClient.requestPermission flow in HuaweiWearEngineService.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions