feat: add typed data and views with scoped device power

This commit is contained in:
Codex
2026-10-25 14:35:24 +08:00
parent 5b99a7e9fc
commit ca60398dea
65 changed files with 4238 additions and 231 deletions
+6 -6
View File
@@ -45,7 +45,7 @@ class AndroidLocationContractTests(unittest.TestCase):
service = next(s for s in manifest.findall('application/service') if s.get(NS+'name') == '.LocationService')
self.assertEqual(service.get(NS+'exported'), 'false')
self.assertEqual(set(service.get(NS+'foregroundServiceType').split('|')), {'location','dataSync'})
boot = (ANDROID/'src/cn/ucvl/zhaodisplay/BootReceiver.java').read_text()
boot = (ANDROID/'src/cn/ucvl/zhaodisplay/BootReceiver.java').read_text(encoding='utf-8')
self.assertNotIn('LocationService', boot)
self.assertIn('phoneMode', boot)
ui = (ANDROID/'src/cn/ucvl/zhaodisplay/LocationActivity.java').read_text(encoding='utf-8')
@@ -72,24 +72,24 @@ class AndroidLocationContractTests(unittest.TestCase):
def test_map_uses_first_party_tiles_and_never_exposes_pairing_token(self):
source = (ANDROID/'src/cn/ucvl/zhaodisplay/LocationMapView.java').read_text(encoding='utf-8')
for text in ('https://zhao.ucvl.cn/maps/phone','shouldInterceptRequest','setGeolocationEnabled(false)','setAllowFileAccess(false)','JSONObject.quote','setItems(new JSONArray())'):
for text in ('ServerEndpoint.MAP_PHONE','ServerEndpoint.mapResource','ServerEndpoint.mapPage','shouldInterceptRequest','setGeolocationEnabled(false)','setAllowFileAccess(false)','JSONObject.quote','setItems(new JSONArray())'):
self.assertIn(text,source)
self.assertNotIn('addJavascriptInterface',source)
self.assertNotIn('getSharedPreferences',source)
def test_phone_three_tabs_use_native_cards_and_keep_sharing_explicit(self):
def test_phone_five_tabs_use_native_cards_and_keep_sharing_explicit(self):
source=(ANDROID/'src/cn/ucvl/zhaodisplay/LocationActivity.java').read_text(encoding='utf-8')
layout=(ANDROID/'src/cn/ucvl/zhaodisplay/PhoneLayout.java').read_text(encoding='utf-8')
for value in ('"位置","沟通","我的"','scrolls[i].setVisibility(i==next?VISIBLE:GONE)','setContentDescription','共享我的位置'):
for value in ('"位置","家庭","设备","沟通","我的"','scrolls[i].setVisibility(i==next?VISIBLE:GONE)','setContentDescription','共享我的位置'):
self.assertIn(value,layout)
for value in ('voice.finish(false);phone.select(tab)','if(content.getParent()==scroll)','开启共享后生效','consent.setChecked(false)','showDetail("允许谁查看"','setLayout(-1,-1)'):
for value in ('phone.select(tab);tabChanged(tab)','void tabChanged(int tab){voice.finish(false);','if(content.getParent()==scroll)','开启共享后生效','consent.setChecked(false)','showDetail("允许谁查看"','setLayout(-1,-1)'):
self.assertIn(value,source)
self.assertNotIn('startService',layout)
self.assertNotIn('https://',layout)
self.assertNotIn('dockSlot',layout)
self.assertIn('sortPositions(response.optJSONArray',source)
self.assertIn('voice.dock.receiverCard',source)
self.assertIn('voice.communication(tab==1)',source)
self.assertIn('voice.communication(tab==PhoneLayout.COMMUNICATION)',source)
def test_voice_page_uses_explicit_receiver_consent_and_cancels_on_navigation(self):
source=(ANDROID/'src/cn/ucvl/zhaodisplay/VoicePanel.java').read_text(encoding='utf-8')