zinwalin
V2EX  ›  Android

定制安卓 10, 系统 OTA 升级过程中如何覆盖 WiFi 之前的配置

  •  
  •   zinwalin · Jul 13, 2022 · 12778 views
    This topic created in 1406 days ago, the information mentioned may be changed or developed.

    比如,OTA 系统升级前,连接过的某个 SSID 配置里,设备睡眠时 WiFi 是关闭的,现在想通过 OTA 升级,把睡眠时 WiFi 默认一直打开。

    换句话说就是这些配置是放在哪里, 怎样通过 OTA 来覆盖? 多谢大神

    5 replies    2022-07-14 19:10:38 +08:00
    4ZfeYd7x90fCplZA
        1
    4ZfeYd7x90fCplZA  
       Jul 14, 2022   ❤️ 1
    在 frameworks 里搜 Settings.Global.WIFI_SLEEP_POLICY 和 R.integer.def_wifi_sleep_policy,
    2 种办法:
    1.写个代码,在 OTA 升级后更改 Settings.Global.WIFI_SLEEP_POLICY ,不需要恢复出厂设置
    2.新系统版本修改 frameworks/base/packages/SettingsProvider/res/values/defaults.xml 的值,但升级后需恢复出厂设置才能重新把 def_wifi_sleep_policy 的值加载到 Settings.Global.WIFI_SLEEP_POLICY
    zinwalin
        2
    zinwalin  
    OP
       Jul 14, 2022
    @ican147 WIFI_SLEEP_POLICY 在 Android 10 只能读不能设置,除非是系统 App
    zinwalin
        3
    zinwalin  
    OP
       Jul 14, 2022
    @ican147 客户希望不需要额外的操作,所以第二种办法可能不合适。
    4ZfeYd7x90fCplZA
        4
    4ZfeYd7x90fCplZA  
       Jul 14, 2022
    有系统源码吧,在系统服务修改 WIFI_SLEEP_POLICY
    zinwalin
        5
    zinwalin  
    OP
       Jul 14, 2022
    @ican147 有,现在就想通过修改系统源码来实现,还得加个是否是 OTA 后第一次启动的判断。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   955 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:42 · PVG 05:42 · LAX 14:42 · JFK 17:42
    ♥ Do have faith in what you're doing.