!1325 don't auto start 'contact ability' when start system

Merge pull request !1325 from zhoujun62/fix_bug
This commit is contained in:
openharmony_ci 2022-03-22 11:54:16 +00:00 committed by Gitee
commit da3e183653
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 0 additions and 58 deletions

View File

@ -56,9 +56,6 @@ const std::string PHONE_SERVICE_BUNDLE_NAME = "com.ohos.callui";
const std::string PHONE_SERVICE_ABILITY_NAME = "com.ohos.callui.ServiceAbility";
const std::string LOCK_SCREEN_EVENT_NAME = "lock_screen";
const std::string CONTACTS_ABILITY_NAME = "com.ohos.contacts.ServiceAbility";
const std::string CONTACTS_BUNDLE_NAME = "com.ohos.contacts";
const std::string MMS_ABILITY_NAME = "com.ohos.mms.ServiceAbility";
const std::string MMS_BUNDLE_NAME = "com.ohos.mms";

View File

@ -986,12 +986,6 @@ private:
*/
void StartingSystemUiAbility(const SatrtUiMode &mode);
/**
* starting contacts ability.
*
*/
void StartingContactsAbility();
/**
* starting mms ability.
*

View File

@ -38,7 +38,6 @@ const std::string APP_NOT_RESPONSE_PROCESS_TIMEOUT_TIME {"app_not_response_proce
const std::string AMS_TIMEOUT_TIME {"ams_timeout_time"};
const std::string SYSTEM_CONFIGURATION {"system_configuration"};
const std::string SYSTEM_ORIENTATION {"system_orientation"};
const std::string STARTUP_CONTACTS {"startup_contacts"};
const std::string STARTUP_MMS {"startup_mms"};
const std::string USE_NEW_MISSION {"use_new_mission"};
const std::string ROOT_LAUNCHER_RESTART_MAX {"root_launcher_restart_max"};
@ -85,11 +84,6 @@ public:
* return false : ams do not start phone service
*/
bool GetPhoneServiceState() const;
/**
* return true : ams can start contacts
* return false : ams do not start contacts
*/
bool GetStartContactsState() const;
/**
* return true : ams can start mms
* return false : ams do not start mms
@ -150,7 +144,6 @@ private:
bool canStartUiStatusBar_ {false};
bool canStartUiNavigationBar_ {false};
bool canStartPhoneService_ {false};
bool canStartContacts {false};
bool canStartMms {false};
bool useNewMission_ {false};
int maxRestartNum_ = 0;

View File

@ -6,7 +6,6 @@
"startup_system_ui_status_bar" : true,
"startup_system_ui_navigation_bar" : true,
"startup_phone_service" : true,
"startup_contacts":true,
"startup_mms":true,
"mission_save_time" : 43200000,
"root_launcher_restart_max":15,

View File

@ -949,7 +949,6 @@ bool AbilityConnectManager::IsAbilityNeedRestart(const std::shared_ptr<AbilityRe
auto findKeepAliveAbility = [abilityRecord](const std::string &mainElemen) {
return (abilityRecord->GetAbilityInfo().name == mainElemen ||
abilityRecord->GetAbilityInfo().name == AbilityConfig::PHONE_SERVICE_ABILITY_NAME ||
abilityRecord->GetAbilityInfo().name == AbilityConfig::CONTACTS_ABILITY_NAME ||
abilityRecord->GetAbilityInfo().name == AbilityConfig::MMS_ABILITY_NAME ||
abilityRecord->GetAbilityInfo().name == AbilityConfig::SYSTEM_UI_ABILITY_NAME ||
abilityRecord->GetAbilityInfo().name == AbilityConfig::LAUNCHER_ABILITY_NAME);

View File

@ -2442,35 +2442,6 @@ void AbilityManagerService::StartingPhoneServiceAbility()
(void)StartAbility(phoneServiceWant, userId, DEFAULT_INVAL_VALUE);
}
void AbilityManagerService::StartingContactsAbility()
{
HILOG_DEBUG("%{public}s", __func__);
auto bms = GetBundleManager();
CHECK_POINTER_IS_NULLPTR(bms);
AppExecFwk::AbilityInfo contactsInfo;
Want contactsWant;
contactsWant.SetElementName(AbilityConfig::CONTACTS_BUNDLE_NAME, AbilityConfig::CONTACTS_ABILITY_NAME);
auto userId = GetUserId();
int attemptNums = 1;
HILOG_DEBUG("%{public}s, QueryAbilityInfo, userId is %{public}d", __func__, userId);
IN_PROCESS_CALL_WITHOUT_RET(
while (!(bms->QueryAbilityInfo(contactsWant,
OHOS::AppExecFwk::AbilityInfoFlag::GET_ABILITY_INFO_DEFAULT, userId, contactsInfo)) &&
attemptNums <= MAX_NUMBER_OF_CONNECT_BMS) {
HILOG_INFO("Waiting query contacts service completed.");
usleep(REPOLL_TIME_MICRO_SECONDS);
attemptNums++;
}
);
HILOG_INFO("attemptNums : %{public}d", attemptNums);
if (attemptNums <= MAX_NUMBER_OF_CONNECT_BMS) {
(void)StartAbility(contactsWant, userId, DEFAULT_INVAL_VALUE);
}
}
void AbilityManagerService::StartingMmsAbility()
{
HILOG_DEBUG("%{public}s", __func__);
@ -3878,11 +3849,6 @@ void AbilityManagerService::StartSystemAbilityByUser(int32_t userId, bool isBoot
StartingPhoneServiceAbility();
}
if (amsConfigResolver_->GetStartContactsState()) {
HILOG_INFO("start contacts");
StartingContactsAbility();
}
if (amsConfigResolver_->GetStartMmsState()) {
HILOG_INFO("start mms");
StartingMmsAbility();

View File

@ -57,11 +57,6 @@ bool AmsConfigurationParameter::GetPhoneServiceState() const
return canStartPhoneService_;
}
bool AmsConfigurationParameter::GetStartContactsState() const
{
return canStartContacts;
}
bool AmsConfigurationParameter::GetStartMmsState() const
{
return canStartMms;
@ -160,7 +155,6 @@ int AmsConfigurationParameter::LoadAppConfigurationForStartUpService(nlohmann::j
Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_NAVIGATION_BAR).get<bool>();
canStartPhoneService_ =
Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_PHONE_SERVICE).get<bool>();
canStartContacts = Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_CONTACTS).get<bool>();
canStartMms = Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::STARTUP_MMS).get<bool>();
missionSaveTime_ = Object.at(AmsConfig::SERVICE_ITEM_AMS).at(AmsConfig::MISSION_SAVE_TIME).get<int>();
anrTime_ =