Class Info |
|---|
public class DeviceStorageManagerEx 设备存储管理类。 |
Qualifier and Type | Method Name and Description |
|---|---|
boolean | setSDWritingDisabled(ComponentName admin, boolean isDisabled) 禁止/允许外置SD卡写入。 |
boolean | isSDWritingDisabled(ComponentName admin) 查询外置SD卡写入禁用状态。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean setSDWritingDisabled(ComponentName admin, boolean isDisabled) 允许/禁止外置SD卡写入。 注意:需要申请com.huawei.permission.sec.MDM_SDCARD权限。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的APK的组件名称,不能为null。 |
isDisabled |
|
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException |
|
IllegalArgumentException | admin为null时。 |
Supported Devices
Device Type | OS Version |
|---|---|
手机、平板 | EMUI 8.0及以上或HarmonyOS 2.0及以上 |
Method |
|---|
public boolean isSDWritingDisabled(ComponentName admin) 获取外置SD卡写入禁用状态。 |
Parameters
Name | Description |
|---|---|
admin | 调用该接口的组件名称。 |
Return
Type | Description |
|---|---|
boolean |
|
Throws
Name | Description |
|---|---|
SecurityException | 此APK未经设备管理激活。 |