Skip to content

Commit 0b5d45b

Browse files
committed
fix: isolate HarmonyOS doctor policy
1 parent 5d6ae94 commit 0b5d45b

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎src/daemon/handlers/session-doctor.ts‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ async function appendDeviceScopedDoctorChecks(
206206
const { androidAdbExecutor, device, options, session, inspectFacts, bindDevice, req } = params;
207207
let listInstalledApps: DoctorAppInventory | undefined;
208208
try {
209-
listInstalledApps = await resolveDoctorAppInventory({
209+
listInstalledApps = await resolveDoctorAppInventoryForDoctor({
210210
device,
211211
req,
212212
targetApp: options.targetApp,
@@ -234,6 +234,15 @@ async function appendDeviceScopedDoctorChecks(
234234
});
235235
}
236236

237+
async function resolveDoctorAppInventoryForDoctor(
238+
params: Parameters<typeof resolveDoctorAppInventory>[0],
239+
): ReturnType<typeof resolveDoctorAppInventory> {
240+
// Doctor's target-app check preserves its legacy HarmonyOS informational cell; this does not
241+
// alter the apps command's facts or runtime binding, which remain available independently.
242+
if (params.device.platform === 'harmonyos') return undefined;
243+
return resolveDoctorAppInventory(params);
244+
}
245+
237246
async function resolveDoctorAppInventory(params: {
238247
device: DeviceInfo;
239248
req: DaemonRequest;
@@ -244,9 +253,7 @@ async function resolveDoctorAppInventory(params: {
244253
((filter: 'all' | 'user-installed') => Promise<readonly InstalledAppInfo[]>) | undefined
245254
> {
246255
const { device, req, targetApp, inspectFacts, bindDevice } = params;
247-
// Doctor's target-app check preserves its legacy HarmonyOS informational cell; this does not
248-
// alter the apps command's facts or runtime binding, which remain available independently.
249-
if (!targetApp || !inspectFacts || !bindDevice || device.platform === 'harmonyos') {
256+
if (!targetApp || !inspectFacts || !bindDevice) {
250257
return undefined;
251258
}
252259
const facts = await inspectFacts(device);

0 commit comments

Comments
 (0)