M3(批1): 占位桩 + 震动 + 剪贴板 + 系统能力 Provider
T-M3-15 RoomStubProvider/PayStubProvider:createRoom/exitRoom/getVideoinfo/DragViewvideoIsshow、
paybrowser/getGameplay 全 void 空实现+日志,绝不触发出站(§6.5 安全网)
T-M3-04 VibrateProvider:vibrator/repeatvibrator/canclevibrator(@ohos.vibrator,重复用递归 setTimeout)
T-M3-05 ClipboardProvider:gameCopytext/gamepastetext(@ohos.pasteboard,读取经 responseCallback 回执)
T-M3-01 AppSystemProvider:orientation(window.setPreferredOrientation 横/竖)、browser(隐式 want)、
finsh(terminateSelf)、openApplyDownloadpath(按包名启动失败回退浏览器)、notification(空)
组装根 buildCapabilities 装配上述 + 桩;module.json5 增 VIBRATE 权限
devecocli build 通过。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* 暂缓能力占位桩(框架 §6.5)。本期视频房(声网)、支付不集成,但 handler 必须"留空注册"——
|
||||
* 否则 H5 调用行为不确定,若 H5 传了 responseCallback 还可能永久挂起。
|
||||
*
|
||||
* 规则:
|
||||
* - void 型 handler:空实现 + 日志,**绝不**调用任何 callHandler 出站。
|
||||
* - 有同步返回的:回安全默认值(本桩涉及的均为 void 型,无同步返回)。
|
||||
* - 绝不触发该能力出站(不 callHandler getVideoinfo / PayuserPaytypePaystate)。
|
||||
* 未来换回真实 RoomProvider/PayProvider 时,契约 handler 名/数量不变,对 H5 零改动。
|
||||
*/
|
||||
import { BridgeController, BridgeHandler } from 'feature_bridge';
|
||||
import { InboundHandlers } from 'contracts';
|
||||
import { CapabilityContext, CapabilityProvider } from '../core/CapabilityProvider';
|
||||
|
||||
/** 视频房占位桩(声网,§6.5)。 */
|
||||
export class RoomStubProvider implements CapabilityProvider {
|
||||
readonly name: string = 'room(stub)';
|
||||
|
||||
register(bridge: BridgeController, ctx: CapabilityContext): void {
|
||||
const noop: BridgeHandler = (_d: string, _cb: (resp: string) => void) => {
|
||||
ctx.log.i('room capability not integrated (stub)');
|
||||
};
|
||||
bridge.registerHandler(InboundHandlers.CreateRoom, noop);
|
||||
bridge.registerHandler(InboundHandlers.ExitRoom, noop);
|
||||
bridge.registerHandler(InboundHandlers.GetVideoInfo, noop);
|
||||
bridge.registerHandler(InboundHandlers.DragViewVideoIsShow, noop);
|
||||
}
|
||||
}
|
||||
|
||||
/** 支付占位桩(本期支付暂缓,§6.5)。 */
|
||||
export class PayStubProvider implements CapabilityProvider {
|
||||
readonly name: string = 'pay(stub)';
|
||||
|
||||
register(bridge: BridgeController, ctx: CapabilityContext): void {
|
||||
const noop: BridgeHandler = (_d: string, _cb: (resp: string) => void) => {
|
||||
ctx.log.i('pay capability not integrated (stub)');
|
||||
};
|
||||
bridge.registerHandler(InboundHandlers.PayBrowser, noop);
|
||||
bridge.registerHandler(InboundHandlers.GetGameplay, noop);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user