common event change

Signed-off-by: 尹耀德 <yinyaode1@huawei.com>
This commit is contained in:
尹耀德 2024-10-21 10:16:39 +08:00
parent 7d03c3936a
commit 526e4e5219
4 changed files with 5 additions and 4 deletions

View File

@ -20,7 +20,8 @@
"ohos.permission.UPDATE_MIGRATE",
"ohos.permission.USE_CLOUD_DRIVE_SERVICE",
"ohos.permission.ATTEST_KEY",
"ohos.permission.USE_TRUSTED_RING"
"ohos.permission.USE_TRUSTED_RING",
"ohos.permission.START_RESTORE_NOTIFICATION"
],
"start-mode" : "condition",
"secon" : "u:r:asset_service:s0"

View File

@ -15,7 +15,7 @@
{ "name": "usual.event.USER_REMOVED" },
{ "name": "usual.event.CHARGING" },
{ "name": "usual.event.USER_UNLOCKED" },
{ "name": "COMMON_EVENT_RESTORE_START" },
{ "name": "usual.event.RESTORE_START" },
{ "name": "USER_PIN_CREATED_EVENT" }
],
"timedevent": [

View File

@ -85,7 +85,7 @@ pub(crate) fn handle_common_event(reason: SystemAbilityOnDemandReason) {
let _ = delete_user_de_dir(reason.extra_data.code);
} else if reason_name == "usual.event.CHARGING" {
listener::backup_db();
} else if reason_name == "COMMON_EVENT_RESTORE_START" {
} else if reason_name == "usual.event.RESTORE_START" {
let want = reason.extra_data.want();
let user_id = match want.get(USER_ID) {
Some(v) => match v.parse::<i32>() {

View File

@ -29,7 +29,7 @@ using namespace OHOS::AppExecFwk::Constants;
using namespace OHOS::EventFwk;
const char * const APP_ID = "appId";
const char * const COMMON_EVENT_RESTORE_START = "COMMON_EVENT_RESTORE_START";
const char * const COMMON_EVENT_RESTORE_START = "usual.event.RESTORE_START";
const char * const COMMON_EVENT_USER_PIN_CREATED = "USER_PIN_CREATED_EVENT";
const char * const BUNDLE_NAME = "bundleName";
const char * const PERMISSION_MANAGE_USER_IDM = "ohos.permission.MANAGE_USER_IDM";