feat: 新增 42 个 Android API 模块
新增模块覆盖: 系统层 (14): system, security, print, opengl, renderscript, transition, test, service_notification, service_controls, service_quicksettings, service_wallpaper, service_autofill, service_dreams, service_vr 应用层 (13): app_admin, app_backup, app_job, app_usage, app_role, app_people, appwidget, companion, credentials, mtp, sip, telecom, speech 硬件媒体层 (15): hardware_display, hardware_fingerprint, hardware_usb, hardware_input, media_audiofx, media_browse, media_session, media_tv, media_midi, media_projection, uwb, se, view_autofill, view_textclassifier, view_translation 总计 94 个模块,75,342 行代码
This commit is contained in:
1 parent
8ad62be068
commit
506f9ac725
43 files changed
+16704
-23
No files matched your search
@@ -0,0 +1,62 @@
|
||||
"""
|
||||
Android Service VR 组件 — VrListenerService 等
|
||||
方法签名完全对齐 Android SDK (android.service.vr 包)
|
||||
"""
|
||||
|
||||
from typing import Any, Callable, List, Optional
|
||||
|
||||
from .._core import Stub, AndroidOnlyError
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
# VrListenerService
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
|
||||
class VrListenerService(Stub):
|
||||
"""VrListenerService — VR 监听服务 (已弃用, 仅存根)"""
|
||||
|
||||
SERVICE_INTERFACE = "android.service.vr.VrListenerService"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self._current_vr_activity: Optional[str] = None
|
||||
self._is_listening: bool = False
|
||||
|
||||
def onCurrentVrActivityChanged(self, component: Any):
|
||||
"""当前 VR Activity 变化时回调"""
|
||||
if component:
|
||||
self._current_vr_activity = str(component)
|
||||
|
||||
def getCurrentVrActivity(self) -> Optional[str]:
|
||||
"""获取当前 VR Activity"""
|
||||
return self._current_vr_activity
|
||||
|
||||
def onConnected(self):
|
||||
"""服务连接回调"""
|
||||
self._is_listening = True
|
||||
|
||||
def onDisconnected(self):
|
||||
"""服务断开回调"""
|
||||
self._is_listening = False
|
||||
|
||||
def isListening(self) -> bool:
|
||||
return self._is_listening
|
||||
|
||||
def toString(self) -> str:
|
||||
return (f"VrListenerService("
|
||||
f"activity={self._current_vr_activity})")
|
||||
|
||||
def hashCode(self) -> int:
|
||||
return id(self) & 0x7FFFFFFF
|
||||
|
||||
def equals(self, other) -> bool:
|
||||
return self is other
|
||||
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
# __all__
|
||||
# ═══════════════════════════════════════════════════════════════
|
||||
|
||||
__all__ = [
|
||||
"VrListenerService",
|
||||
]
|
||||
Reference in new issue
Block a user