fix: system options crash

Update docs
This commit is contained in:
BinTianqi
2026-03-01 15:53:49 +08:00
parent ed330a2b63
commit f79474224c
3 changed files with 14 additions and 12 deletions

View File

@@ -35,17 +35,15 @@
## FAQ ## FAQ
### 设备上有账号 ### 设备上有账号
```text ```text
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device
``` ```
解决办法: 解决办法:冻结持有这些账号的app或删除这些账号。
- 冻结持有这些账号的app。
- 删除这些账号。
### 设备上有多个用户 ### 设备上有多个用户
```text ```text
java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device
@@ -86,7 +84,7 @@ user limit reached
三星限制了多用户功能,暂无解决办法。 三星限制了多用户功能,暂无解决办法。
### 创建工作资料 ### 创建工作资料/用户
在大部分设备上设置device owner后不能创建工作资料因为系统在设置device owner时会添加`no_add_managed_profile`等用户限制。 在大部分设备上设置device owner后不能创建工作资料因为系统在设置device owner时会添加`no_add_managed_profile`等用户限制。
Device owner不能修改系统设置的用户限制但如果你有root权限你可以在adb shell中执行以下命令以关闭这个限制。 Device owner不能修改系统设置的用户限制但如果你有root权限你可以在adb shell中执行以下命令以关闭这个限制。
@@ -98,6 +96,9 @@ pm set-user-restriction no_add_private_profile 0
pm set-user-restriction no_add_clone_profile 0 pm set-user-restriction no_add_clone_profile 0
``` ```
一些系统在设置了device owner后不允许在安卓设置中创建用户你可以在OwnDroid中创建用户。
如果你有root你也可以在adb shell中运行以上命令以解除限制。
## API ## API
OwnDroid提供了一个基于Intent的API。你需要在设置中设置密钥并启用API。括号中的数字是最小的安卓版本。 OwnDroid提供了一个基于Intent的API。你需要在设置中设置密钥并启用API。括号中的数字是最小的安卓版本。

View File

@@ -41,9 +41,7 @@ Use Android's DevicePolicyManager API to manage your device.
java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device java.lang.IllegalStateException: Not allowed to set the device owner because there are already some accounts on the device
``` ```
Solutions: Solutions: freeze the accounts' holder apps, or delete those accounts.
- Freeze apps who hold those accounts.
- Delete these accounts.
### Already several users on the device ### Already several users on the device
@@ -59,7 +57,7 @@ Solution: Delete secondary users, including work profile, private space and app
java.lang.IllegalStateException: Trying to set the device owner (com.bintianqi.owndroid/.Receiver), but device owner (xxx) is already set. java.lang.IllegalStateException: Trying to set the device owner (com.bintianqi.owndroid/.Receiver), but device owner (xxx) is already set.
``` ```
Only 1 device owner can exist on a device. Please deactivate the existing device owner first. Only one device owner can exist on a device. Please deactivate the existing device owner first.
### MIUI & HyperOS ### MIUI & HyperOS
@@ -87,7 +85,7 @@ user limit reached
Samsung restricts Android's multiple users feature. There is currently no solution. Samsung restricts Android's multiple users feature. There is currently no solution.
### Create work profile ### Create work profile / user
On most devices, creating work profile is not allowed by the system when the device owner exist. On most devices, creating work profile is not allowed by the system when the device owner exist.
Because the system add `no_add_managed_profile` user restriction when a device owner is set. Because the system add `no_add_managed_profile` user restriction when a device owner is set.
@@ -100,6 +98,9 @@ pm set-user-restriction no_add_private_profile 0
pm set-user-restriction no_add_clone_profile 0 pm set-user-restriction no_add_clone_profile 0
``` ```
Some systems disable the feature of adding users in Android settings once a device owner is set.
You have to create users in OwnDroid. Or if you have root, run the above command in adb shell to remove that restriction.
## API ## API
OwnDroid provides an Intent-based API. You need to set the API key in settings and enable the API. The numbers in brackets represent the minimum Android version required. OwnDroid provides an Intent-based API. You need to set the API key in settings and enable the API. The numbers in brackets represent the minimum Android version required.

View File

@@ -22,7 +22,7 @@ data class SystemOptionsStatus(
class GlobalSetting(val icon: Int, val name: Int, val setting: String) // also for secure settings class GlobalSetting(val icon: Int, val name: Int, val setting: String) // also for secure settings
val globalSettings = listOf( val globalSettings = listOf(
GlobalSetting(R.drawable.cell_tower_fill0, R.string.data_roaming, Settings.Global.DATA_ROAMING), //GlobalSetting(R.drawable.cell_tower_fill0, R.string.data_roaming, Settings.Global.DATA_ROAMING),
GlobalSetting(R.drawable.adb_fill0, R.string.enable_adb, Settings.Global.ADB_ENABLED), GlobalSetting(R.drawable.adb_fill0, R.string.enable_adb, Settings.Global.ADB_ENABLED),
GlobalSetting(R.drawable.usb_fill0, R.string.enable_usb_mass_storage, GlobalSetting(R.drawable.usb_fill0, R.string.enable_usb_mass_storage,
Settings.Global.USB_MASS_STORAGE_ENABLED), Settings.Global.USB_MASS_STORAGE_ENABLED),