mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-24 22:21:36 -04:00
@@ -121,6 +121,7 @@ declare_args() {
|
||||
ability_runtime_start_window_options_with_pixelmap = false
|
||||
ability_runtime_check_internet_permission = false
|
||||
ability_runtime_media_library_enable = true
|
||||
ability_runtime_no_screen = false
|
||||
|
||||
if (!defined(global_parts_info) ||
|
||||
defined(global_parts_info.account_os_account)) {
|
||||
|
||||
+2
-1
@@ -30,7 +30,8 @@
|
||||
"ability_runtime_app_no_response_dialog_wearable",
|
||||
"ability_runtime_app_no_response_bundlename",
|
||||
"ability_runtime_start_window_options_with_pixelmap",
|
||||
"ability_runtime_check_internet_permission"
|
||||
"ability_runtime_check_internet_permission",
|
||||
"ability_runtime_no_screen"
|
||||
],
|
||||
"adapted_system_type": [
|
||||
"standard"
|
||||
|
||||
@@ -278,6 +278,10 @@ ohos_shared_library("abilityms") {
|
||||
external_deps += [ "image_framework:image_native" ]
|
||||
}
|
||||
|
||||
if (ability_runtime_no_screen) {
|
||||
defines += ["AMS_NO_SCREEN"]
|
||||
}
|
||||
|
||||
version_script = "libabilityms.map"
|
||||
subsystem_name = "ability"
|
||||
innerapi_tags = [ "platformsdk_indirect" ]
|
||||
|
||||
@@ -2161,11 +2161,13 @@ private:
|
||||
*/
|
||||
void InitU0User();
|
||||
void InitStartAbilityChain();
|
||||
#ifndef AMS_NO_SCREEN
|
||||
/**
|
||||
* start highest priority ability.
|
||||
*
|
||||
*/
|
||||
int StartHighestPriorityAbility(int32_t userId, bool isBoot, bool isAppRecovery = false);
|
||||
#endif
|
||||
/**
|
||||
* connect bms.
|
||||
*
|
||||
|
||||
@@ -6822,7 +6822,7 @@ int32_t AbilityManagerService::GetUserId() const
|
||||
}
|
||||
return U0_USER_ID;
|
||||
}
|
||||
|
||||
#ifndef AMS_NO_SCREEN
|
||||
int AbilityManagerService::StartHighestPriorityAbility(int32_t userId, bool isBoot, bool isAppRecovery)
|
||||
{
|
||||
TAG_LOGD(AAFwkTag::ABILITYMGR, "%{public}s", __func__);
|
||||
@@ -6882,7 +6882,7 @@ int AbilityManagerService::StartHighestPriorityAbility(int32_t userId, bool isBo
|
||||
/* note: OOBE APP need disable itself, otherwise, it will be started when restart system everytime */
|
||||
return StartAbility(abilityWant, userId, DEFAULT_INVAL_VALUE);
|
||||
}
|
||||
|
||||
#endif
|
||||
int AbilityManagerService::GenerateAbilityRequest(const Want &want, int requestCode, AbilityRequest &request,
|
||||
const sptr<IRemoteObject> &callerToken, int32_t userId)
|
||||
{
|
||||
@@ -8978,11 +8978,15 @@ int AbilityManagerService::SwitchToUser(int32_t oldUserId, int32_t userId, sptr<
|
||||
ConnectServices();
|
||||
StartUserApps();
|
||||
}
|
||||
#ifndef AMS_NO_SCREEN
|
||||
bool isBoot = oldUserId == U0_USER_ID ? true : false;
|
||||
auto ret = StartHighestPriorityAbility(userId, isBoot, isAppRecovery);
|
||||
if (ret != ERR_OK) {
|
||||
TAG_LOGE(AAFwkTag::ABILITYMGR, "StartHighestPriorityAbility failed: %{public}d", ret);
|
||||
}
|
||||
#else
|
||||
auto ret = ERR_OK;
|
||||
#endif
|
||||
if (callback) {
|
||||
callback->OnStartUserDone(userId, ret);
|
||||
}
|
||||
|
||||
+2
-2
@@ -575,7 +575,7 @@ HWTEST_F(AbilityManagerServiceTenhtTest, ScheduleCommandAbilityWindowDone_004, T
|
||||
EXPECT_EQ(ret, ERR_INVALID_VALUE);
|
||||
TAG_LOGI(AAFwkTag::TEST, "AbilityManagerServiceTenhtTest ScheduleCommandAbilityWindowDone_004 end");
|
||||
}
|
||||
|
||||
#ifndef AMS_NO_SCREEN
|
||||
/*
|
||||
* Feature: AbilityManagerService
|
||||
* Name: StartHighestPriorityAbility_001
|
||||
@@ -594,7 +594,7 @@ HWTEST_F(AbilityManagerServiceTenhtTest, StartHighestPriorityAbility_001, TestSi
|
||||
EXPECT_EQ(ret, RESOLVE_ABILITY_ERR);
|
||||
TAG_LOGI(AAFwkTag::TEST, "AbilityManagerServiceTenhtTest StartHighestPriorityAbility_001 end");
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Feature: AbilityManagerService
|
||||
* Name: DelegatorDoAbilityBackground_001
|
||||
|
||||
Reference in New Issue
Block a user