Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
192ffada
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
192ffada
编写于
7月 07, 2022
作者:
C
caiminggang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加EnterpriseAdminExtentionAbility模块描述
Signed-off-by:
N
caiminggang
<
caiminggang1@huawei.com
>
上级
5c8c3c08
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
127 addition
and
134 deletion
+127
-134
zh-cn/application-dev/reference/apis/js-apis-EnterpriseAdminExtensionAbility.md
...reference/apis/js-apis-EnterpriseAdminExtensionAbility.md
+14
-11
zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md
...n-dev/reference/apis/js-apis-enterprise-device-manager.md
+113
-123
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-EnterpriseAdminExtensionAbility.md
浏览文件 @
192ffada
# EnterpriseAdminExtentionAbility
# EnterpriseAdminExtentionAbility
EnterpriseAdminExtentionAbility模块提供企业管理员应用扩展相关接口。
本模块提供企业管理员应用拓展能力。
企业管理员应用需要存在一个EnterpriseAdminExtentionAbility并重写相关接口,以此具备模块提供的各项能力,比如接收由系统发送的该应用被激活或者去激活的通知。
> **说明:**
> **说明:**
>
>
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> 本模块接口仅可在Stage模型下使用。
> 本模块接口仅可在Stage模型下使用。
## 导入模块
## 导入模块
```
ts
```
ts
...
@@ -22,12 +26,12 @@ onAdminEnabled(): void
...
@@ -22,12 +26,12 @@ onAdminEnabled(): void
**示例:**
**示例:**
```
ts
```
ts
export
default
class
EnterpriseAdminAbility
extends
EnterpriseAdminExtensionAbility
{
export
default
class
EnterpriseAdminAbility
extends
EnterpriseAdminExtensionAbility
{
onAdminEnabled
()
{
onAdminEnabled
()
{
}
}
};
};
```
```
## EnterpriseAdminExtentionAbility.onAdminDisabled
## EnterpriseAdminExtentionAbility.onAdminDisabled
...
@@ -38,11 +42,10 @@ onAdminDisabled(): void
...
@@ -38,11 +42,10 @@ onAdminDisabled(): void
**系统能力**
:SystemCapability.Customation.EnterpriseDeviceManager
**系统能力**
:SystemCapability.Customation.EnterpriseDeviceManager
**示例:**
**示例:**
```
ts
```
ts
export
default
class
EnterpriseAdminAbility
extends
EnterpriseAdminExtensionAbility
{
export
default
class
EnterpriseAdminAbility
extends
EnterpriseAdminExtensionAbility
{
onAdminDisabled
()
{
onAdminDisabled
()
{
}
}
};
};
```
```
\ No newline at end of file
zh-cn/application-dev/reference/apis/js-apis-enterprise-device-manager.md
浏览文件 @
192ffada
# 企业设备管理
# 企业设备管理
本模块提供企业设备管理能力,使设备具备企业场景下所需的定制能力。
> **说明:**
> **说明:**
>
>
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
## 导入模块
```
js
```
js
import
enterpriseDeviceManager
from
'
@ohos.enterpriseDeviceManager
'
;
import
enterpriseDeviceManager
from
'
@ohos.enterpriseDeviceManager
'
;
```
```
## enterpriseDeviceManager.enableAdmin
## enterpriseDeviceManager.enableAdmin
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number, callback: AsyncCallback
\<
boolean>): void
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number, callback: AsyncCallback
\<
boolean>): void
...
@@ -26,24 +26,24 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -26,24 +26,24 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名
| 类型 | 必填 | 说明
|
| 参数名
| 类型 | 必填 | 说明
|
| -------------- | ----------------------------------- | ---
- | -------------------------
---------------------------- |
| -------------- | ----------------------------------- | ---
|
---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用
|
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息
|
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型
|
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否激活成功
|
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否激活成功 |
**示例**
:
**示例**
:
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
com.example.myapplication
"
,
bundleName
:
"
com.example.myapplication
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
};
};
let
enterpriseInfo
=
{
let
enterpriseInfo
=
{
name
:
"
enterprise name
"
,
name
:
"
enterprise name
"
,
description
:
"
enterprise description
"
description
:
"
enterprise description
"
}
}
enterpriseDeviceManager
.
enableAdmin
(
wantTemp
,
enterpriseInfo
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
100
,
(
error
,
result
)
=>
{
enterpriseDeviceManager
.
enableAdmin
(
wantTemp
,
enterpriseInfo
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
100
,
(
error
,
result
)
=>
{
if
(
error
!=
null
)
{
if
(
error
!=
null
)
{
...
@@ -68,11 +68,11 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -68,11 +68,11 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名
| 类型 | 必填 | 说明
|
| 参数名
| 类型 | 必填 | 说明
|
| -------------- | ----------------------------------- | ---
- | -------------------------
---------------------------- |
| -------------- | ----------------------------------- | ---
|
---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用
|
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息
|
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型
|
| type |
[
AdminType
](
#AdminType
)
| 是 | 激活的设备管理员类型 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
**返回值:**
**返回值:**
...
@@ -85,18 +85,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -85,18 +85,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
com.example.myapplication
"
,
bundleName
:
"
com.example.myapplication
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
};
};
let
enterpriseInfo
=
{
let
enterpriseInfo
=
{
name
:
"
enterprise name
"
,
name
:
"
enterprise name
"
,
description
:
"
enterprise description
"
description
:
"
enterprise description
"
}
}
enterpriseDeviceManager
.
enableAdmin
(
wantTemp
,
enterpriseInfo
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
100
)
enterpriseDeviceManager
.
enableAdmin
(
wantTemp
,
enterpriseInfo
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
100
)
.
then
((
result
)
=>
{
.
then
((
result
)
=>
{
console
.
log
(
"
result is
"
+
result
);
console
.
log
(
"
result is
"
+
result
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
...
@@ -114,18 +114,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -114,18 +114,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名
| 类型 | 必填 | 说明
|
| 参数名
| 类型 | 必填 | 说明
|
| -------- | ----------------------------------- | ---
- | -------------------------
---------------------------- |
| -------- | ----------------------------------- | ---
|
---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用
|
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功
|
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
**示例**
:
**示例**
:
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
abilityName
:
"
abilityName
"
,
};
};
enterpriseDeviceManager
.
disableAdmin
(
wantTemp
,
100
,
(
error
,
result
)
=>
{
enterpriseDeviceManager
.
disableAdmin
(
wantTemp
,
100
,
(
error
,
result
)
=>
{
if
(
error
!=
null
)
{
if
(
error
!=
null
)
{
...
@@ -136,8 +136,6 @@ enterpriseDeviceManager.disableAdmin(wantTemp, 100, (error, result) => {
...
@@ -136,8 +136,6 @@ enterpriseDeviceManager.disableAdmin(wantTemp, 100, (error, result) => {
});
});
```
```
## enterpriseDeviceManager.disableAdmin
## enterpriseDeviceManager.disableAdmin
disableAdmin(admin: Want, userId?: number): Promise
\<
boolean>
disableAdmin(admin: Want, userId?: number): Promise
\<
boolean>
...
@@ -152,9 +150,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -152,9 +150,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名
| 类型 | 必填 | 说明
|
| 参数名
| 类型 | 必填 | 说明
|
| ------ | ----------------------------------- | ---
- | -------------------------
---------------------------- |
| ------ | ----------------------------------- | ---
|
---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用
|
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 普通设备管理员应用 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
**返回值:**
**返回值:**
...
@@ -167,13 +165,13 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -167,13 +165,13 @@ SystemCapability.Customation.EnterpriseDeviceManager
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
abilityName
:
"
abilityName
"
,
};
};
enterpriseDeviceManager
.
disableAdmin
(
wantTemp
,
100
).
then
((
result
)
=>
{
enterpriseDeviceManager
.
disableAdmin
(
wantTemp
,
100
).
then
((
result
)
=>
{
console
.
log
(
"
result is
"
+
result
);
console
.
log
(
"
result is
"
+
result
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
...
@@ -188,10 +186,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -188,10 +186,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ----------------------- | ---
-
| ------------------- |
| ---------- | ----------------------- | --- | ------------------- |
| bundleName | String | 是
| 超级设备管理员应用的包名 |
| bundleName | String | 是 | 超级设备管理员应用的包名 |
| callback | AsyncCallback
\<
boolean> | 是
| callback方式返回是否去激活成功 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否去激活成功 |
**示例**
:
**示例**
:
...
@@ -217,9 +215,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -217,9 +215,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------ | ---
-
| ------------ |
| ---------- | ------ | --- | ------------ |
| bundleName | String | 是
| 超级设备管理员应用的包名 |
| bundleName | String | 是 | 超级设备管理员应用的包名 |
**返回值:**
**返回值:**
...
@@ -232,9 +230,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -232,9 +230,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
```
js
```
js
let
bundleName
=
"
com.example.myapplication
"
;
let
bundleName
=
"
com.example.myapplication
"
;
enterpriseDeviceManager
.
disableSuperAdmin
(
bundleName
).
then
((
result
)
=>
{
enterpriseDeviceManager
.
disableSuperAdmin
(
bundleName
).
then
((
result
)
=>
{
console
.
log
(
"
result is
"
+
result
);
console
.
log
(
"
result is
"
+
result
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
...
@@ -249,18 +247,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -249,18 +247,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名
| 类型 | 必填 | 说明
|
| 参数名
| 类型 | 必填 | 说明
|
| -------- | ----------------------------------- | ---
- | -------------------------
---------------------------- |
| -------- | ----------------------------------- | ---
|
---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用
|
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态
|
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
**示例**
:
**示例**
:
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
abilityName
:
"
abilityName
"
,
};
};
enterpriseDeviceManager
.
isAdminEnabled
(
wantTemp
,
100
,
(
error
,
result
)
=>
{
enterpriseDeviceManager
.
isAdminEnabled
(
wantTemp
,
100
,
(
error
,
result
)
=>
{
if
(
error
!=
null
)
{
if
(
error
!=
null
)
{
...
@@ -271,8 +269,6 @@ enterpriseDeviceManager.isAdminEnabled(wantTemp, 100, (error, result) => {
...
@@ -271,8 +269,6 @@ enterpriseDeviceManager.isAdminEnabled(wantTemp, 100, (error, result) => {
});
});
```
```
## enterpriseDeviceManager.isAdminEnabled
## enterpriseDeviceManager.isAdminEnabled
isAdminEnabled(admin: Want, userId?: number): Promise
\<
boolean>
isAdminEnabled(admin: Want, userId?: number): Promise
\<
boolean>
...
@@ -284,9 +280,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -284,9 +280,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名
| 类型 | 必填 | 说明
|
| 参数名
| 类型 | 必填 | 说明
|
| ------ | ----------------------------------- | ---
- | -------------------------
---------------------------- |
| ------ | ----------------------------------- | ---
|
---------------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用
|
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
**返回值:**
**返回值:**
...
@@ -299,13 +295,13 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -299,13 +295,13 @@ SystemCapability.Customation.EnterpriseDeviceManager
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
abilityName
:
"
abilityName
"
,
};
};
enterpriseDeviceManager
.
isAdminEnabled
(
wantTemp
,
100
).
then
((
result
)
=>
{
enterpriseDeviceManager
.
isAdminEnabled
(
wantTemp
,
100
).
then
((
result
)
=>
{
console
.
log
(
"
result is
"
+
result
);
console
.
log
(
"
result is
"
+
result
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
...
@@ -320,10 +316,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -320,10 +316,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ----------------------- | ---
-
| -------------------- |
| ---------- | ----------------------- | --- | -------------------- |
| bundleName | String | 是
| 设备管理员应用 |
| bundleName | String | 是 | 设备管理员应用 |
| callback | AsyncCallback
\<
boolean> | 是
| callback方式返回是否处于激活状态 |
| callback | AsyncCallback
\<
boolean> | 是 | callback方式返回是否处于激活状态 |
**示例**
:
**示例**
:
...
@@ -338,8 +334,6 @@ enterpriseDeviceManager.isSuperAdmin(bundleName, (error, result) => {
...
@@ -338,8 +334,6 @@ enterpriseDeviceManager.isSuperAdmin(bundleName, (error, result) => {
});
});
```
```
## enterpriseDeviceManager.isSuperAdmin
## enterpriseDeviceManager.isSuperAdmin
isSuperAdmin(bundleName: String): Promise
\<
boolean>
isSuperAdmin(bundleName: String): Promise
\<
boolean>
...
@@ -351,9 +345,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -351,9 +345,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数**
:
**参数**
:
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------ | ---
-
| --------- |
| ---------- | ------ | --- | --------- |
| bundleName | String | 是
| 超级设备管理员应用 |
| bundleName | String | 是 | 超级设备管理员应用 |
**返回值:**
**返回值:**
...
@@ -366,9 +360,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -366,9 +360,9 @@ SystemCapability.Customation.EnterpriseDeviceManager
```
js
```
js
let
bundleName
=
"
com.example.myapplication
"
;
let
bundleName
=
"
com.example.myapplication
"
;
enterpriseDeviceManager
.
isSuperAdmin
(
bundleName
).
then
((
result
)
=>
{
enterpriseDeviceManager
.
isSuperAdmin
(
bundleName
).
then
((
result
)
=>
{
console
.
log
(
"
result is
"
+
result
);
console
.
log
(
"
result is
"
+
result
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
...
@@ -383,16 +377,16 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -383,16 +377,16 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------- | ---
-
| ----------------------------------- |
| -------- | --------------------------------------- | --- | ----------------------------------- |
| callback | AsyncCallback<DeviceSettingsManager
>
| 是
| callback方式返回DeviceSettingsManager对象 |
| callback | AsyncCallback<DeviceSettingsManager
>
| 是 | callback方式返回DeviceSettingsManager对象 |
**示例:**
**示例:**
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
abilityName
:
"
abilityName
"
,
};
};
enterpriseDeviceManager
.
getDeviceSettingsManager
((
error
,
mgr
)
=>
{
enterpriseDeviceManager
.
getDeviceSettingsManager
((
error
,
mgr
)
=>
{
if
(
error
!=
null
)
{
if
(
error
!=
null
)
{
...
@@ -409,7 +403,6 @@ enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => {
...
@@ -409,7 +403,6 @@ enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => {
});
});
```
```
## enterpriseDeviceManager.getDeviceSettingsManager
## enterpriseDeviceManager.getDeviceSettingsManager
getDeviceSettingsManager(): Promise
<
DeviceSettingsManager
>
getDeviceSettingsManager(): Promise
<
DeviceSettingsManager
>
...
@@ -429,8 +422,8 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -429,8 +422,8 @@ SystemCapability.Customation.EnterpriseDeviceManager
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
abilityName
:
"
abilityName
"
,
};
};
mgr
.
getDeviceSettingsManager
().
then
((
mgr
)
=>
{
mgr
.
getDeviceSettingsManager
().
then
((
mgr
)
=>
{
mgr
.
setDateTime
(
wantTemp
,
1526003846000
).
then
((
value
)
=>
{
mgr
.
setDateTime
(
wantTemp
,
1526003846000
).
then
((
value
)
=>
{
...
@@ -454,32 +447,31 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -454,32 +447,31 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ----------------------------------- | ---
-
| ---------------------- |
| -------------- | ----------------------------------- | --- | ---------------------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是
| 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是
| 设备管理员应用的企业信息 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
| callback | AsyncCallback
\<
boolean
>
| 是
| callback方式返回是否设置企业信息成功 |
| callback | AsyncCallback
\<
boolean
>
| 是 | callback方式返回是否设置企业信息成功 |
**示例:**
**示例:**
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
com.example.myapplication
"
,
bundleName
:
"
com.example.myapplication
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
};
};
let
enterpriseInfo
=
{
let
enterpriseInfo
=
{
name
:
"
enterprise name
"
,
name
:
"
enterprise name
"
,
description
:
"
enterprise description
"
description
:
"
enterprise description
"
}
}
enterpriseDeviceManager
.
setEnterpriseInfo
(
wantTemp
,
enterpriseInfo
)
enterpriseDeviceManager
.
setEnterpriseInfo
(
wantTemp
,
enterpriseInfo
)
.
then
((
result
)
=>
{
.
then
((
result
)
=>
{
console
.
log
(
"
result is
"
+
result
);
console
.
log
(
"
result is
"
+
result
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
## enterpriseDeviceManager.setEnterpriseInfo
## enterpriseDeviceManager.setEnterpriseInfo
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise
<
boolean
>
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise
<
boolean
>
...
@@ -491,10 +483,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -491,10 +483,10 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------------- | ----------------------------------- | ---
-
| ------------ |
| -------------- | ----------------------------------- | --- | ------------ |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是
| 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是
| 设备管理员应用的企业信息 |
| enterpriseInfo |
[
EnterpriseInfo
](
#EnterpriseInfo
)
| 是 | 设备管理员应用的企业信息 |
**返回值:**
**返回值:**
...
@@ -506,18 +498,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -506,18 +498,18 @@ SystemCapability.Customation.EnterpriseDeviceManager
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
com.example.myapplication
"
,
bundleName
:
"
com.example.myapplication
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
};
};
let
enterpriseInfo
=
{
let
enterpriseInfo
=
{
name
:
"
enterprise name
"
,
name
:
"
enterprise name
"
,
description
:
"
enterprise description
"
description
:
"
enterprise description
"
}
}
enterpriseDeviceManager
.
setEnterpriseInfo
(
wantTemp
,
enterpriseInfo
)
enterpriseDeviceManager
.
setEnterpriseInfo
(
wantTemp
,
enterpriseInfo
)
.
then
((
result
)
=>
{
.
then
((
result
)
=>
{
console
.
log
(
"
result is
"
+
result
);
console
.
log
(
"
result is
"
+
result
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
...
@@ -532,17 +524,17 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -532,17 +524,17 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型
| 必填
| 说明 |
| 参数名 | 类型
| 必填
| 说明 |
| -------- | ----------------------------------------
| -
--- | ------------------------ |
| -------- | ----------------------------------------
-------------- |
--- | ------------------------ |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是
| 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是
| 设备管理员应用 |
| callback | AsyncCallback
<
[EnterpriseInfo](#EnterpriseInfo)
>
| 是
| callback方式返回设备管理员应用的企业信息 |
| callback | AsyncCallback
<
[EnterpriseInfo](#EnterpriseInfo)
>
| 是 | callback方式返回设备管理员应用的企业信息 |
**示例:**
**示例:**
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
com.example.myapplication
"
,
bundleName
:
"
com.example.myapplication
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
};
};
enterpriseDeviceManager
.
getEnterpriseInfo
(
wantTemp
,
(
error
,
result
)
=>
{
enterpriseDeviceManager
.
getEnterpriseInfo
(
wantTemp
,
(
error
,
result
)
=>
{
if
(
error
!=
null
)
{
if
(
error
!=
null
)
{
...
@@ -550,11 +542,10 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp, (error, result) => {
...
@@ -550,11 +542,10 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp, (error, result) => {
return
;
return
;
}
}
console
.
log
(
result
.
name
);
console
.
log
(
result
.
name
);
console
.
log
(
result
.
description
);
console
.
log
(
result
.
description
);
});
});
```
```
## enterpriseDeviceManager.getEnterpriseInfo
## enterpriseDeviceManager.getEnterpriseInfo
getEnterpriseInfo(admin: Want): Promise
<
EnterpriseInfo
>
getEnterpriseInfo(admin: Want): Promise
<
EnterpriseInfo
>
...
@@ -566,28 +557,28 @@ SystemCapability.Customation.EnterpriseDeviceManager
...
@@ -566,28 +557,28 @@ SystemCapability.Customation.EnterpriseDeviceManager
**参数:**
**参数:**
| 参数名 | 类型 | 必填
| 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ----- | ----------------------------------- | ---
-
| ------- |
| ----- | ----------------------------------- | --- | ------- |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是
| 设备管理员应用 |
| admin |
[
Want
](
js-apis-application-Want.md
)
| 是 | 设备管理员应用 |
**返回值:**
**返回值:**
| 类型 | 说明 |
| 类型
| 说明 |
| ---------------------------------------- | ------------------------- |
| ----------------------------------------
--------
| ------------------------- |
| Promise
<
[EnterpriseInfo](#EnterpriseInfo)
>
| Promise方式返回设备管理员应用的企业信息对象 |
| Promise
<
[EnterpriseInfo](#EnterpriseInfo)
>
| Promise方式返回设备管理员应用的企业信息对象 |
**示例:**
**示例:**
```
js
```
js
let
wantTemp
=
{
let
wantTemp
=
{
bundleName
:
"
com.example.myapplication
"
,
bundleName
:
"
com.example.myapplication
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
abilityName
:
"
com.example.myapplication.MainAbility
"
,
};
};
enterpriseDeviceManager
.
getEnterpriseInfo
(
wantTemp
).
then
((
result
)
=>
{
enterpriseDeviceManager
.
getEnterpriseInfo
(
wantTemp
).
then
((
result
)
=>
{
console
.
log
(
result
.
name
);
console
.
log
(
result
.
name
);
console
.
log
(
result
.
description
);
console
.
log
(
result
.
description
);
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"
error occurs
"
+
error
);
console
.
log
(
"
error occurs
"
+
error
);
});
});
```
```
...
@@ -602,7 +593,6 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp).then((result) => {
...
@@ -602,7 +593,6 @@ enterpriseDeviceManager.getEnterpriseInfo(wantTemp).then((result) => {
| name | 只读 | string | 是 | 表示设备管理员应用所属企业的名称。 |
| name | 只读 | string | 是 | 表示设备管理员应用所属企业的名称。 |
| description | 只读 | string | 是 | 表示设备管理员应用所属企业的描述。 |
| description | 只读 | string | 是 | 表示设备管理员应用所属企业的描述。 |
## AdminType
## AdminType
设备管理员应用的管理员类型。
设备管理员应用的管理员类型。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录