!2287 [Bug]: ACTIVED->ACTIVATED

Merge pull request !2287 from 王力量/day1118_ACTIVED
This commit is contained in:
openharmony_ci 2024-11-20 10:42:23 +00:00 committed by Gitee
commit 75db57a509
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 9 additions and 9 deletions

View File

@ -2579,7 +2579,7 @@ HWTEST_F(OsAccountManagerModuleTest, OsAccountManagerModuleTest116, TestSize.Lev
EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activingSubscriber)); EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activingSubscriber));
EXPECT_CALL(*activingSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1)); EXPECT_CALL(*activingSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1));
// activated os account // activated os account
OsAccountSubscribeInfo subscribeActivatedInfo(OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVED, "subscribeActived"); OsAccountSubscribeInfo subscribeActivatedInfo(OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATED, "subscribeActivated");
auto activedSubscriber = std::make_shared<ActiveOsAccountSubscriber>(subscribeActivatedInfo); auto activedSubscriber = std::make_shared<ActiveOsAccountSubscriber>(subscribeActivatedInfo);
EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activedSubscriber)); EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activedSubscriber));
EXPECT_CALL(*activedSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1)); EXPECT_CALL(*activedSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1));
@ -2702,7 +2702,7 @@ HWTEST_F(OsAccountManagerModuleTest, OsAccountManagerModuleTest118, TestSize.Lev
EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activingSubscriber)); EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activingSubscriber));
EXPECT_CALL(*activingSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1)); EXPECT_CALL(*activingSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1));
// activated os account // activated os account
OsAccountSubscribeInfo subscribeActivatedInfo(OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVED, "subscribeActived"); OsAccountSubscribeInfo subscribeActivatedInfo(OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATED, "subscribeActived");
auto activedSubscriber = std::make_shared<ActiveOsAccountSubscriber>(subscribeActivatedInfo); auto activedSubscriber = std::make_shared<ActiveOsAccountSubscriber>(subscribeActivatedInfo);
EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activedSubscriber)); EXPECT_EQ(ERR_OK, OsAccountManager::SubscribeOsAccount(activedSubscriber));
EXPECT_CALL(*activedSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1)); EXPECT_CALL(*activedSubscriber, OnAccountsChanged(account.GetLocalId())).Times(Exactly(1));

View File

@ -62,7 +62,7 @@ void OsAccountSubscribeInfoTest::TearDown(void)
*/ */
HWTEST_F(OsAccountSubscribeInfoTest, OsAccountSubscribeInfoTestTest01, TestSize.Level0) HWTEST_F(OsAccountSubscribeInfoTest, OsAccountSubscribeInfoTestTest01, TestSize.Level0)
{ {
OsAccountSubscribeInfo osAccountSubscribeInfo(ACTIVED, STRING_NAME); OsAccountSubscribeInfo osAccountSubscribeInfo(ACTIVATED, STRING_NAME);
Parcel parcel; Parcel parcel;
EXPECT_EQ(true, osAccountSubscribeInfo.Marshalling(parcel)); EXPECT_EQ(true, osAccountSubscribeInfo.Marshalling(parcel));

View File

@ -23,7 +23,7 @@ namespace OHOS {
namespace AccountSA { namespace AccountSA {
typedef enum { typedef enum {
INVALID_TYPE = -1, INVALID_TYPE = -1,
ACTIVED = 0, ACTIVATED = 0,
ACTIVATING, ACTIVATING,
UNLOCKED, UNLOCKED,
CREATED, CREATED,

View File

@ -1798,7 +1798,7 @@ static bool ParseParamForActiveSubscriber(const napi_env &env, const std::string
// argv[0] type: 'activate' | 'activating' // argv[0] type: 'activate' | 'activating'
if (type == "activate") { if (type == "activate") {
asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVED; asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATED;
} else { } else {
asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATING; asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATING;
} }
@ -1899,7 +1899,7 @@ static bool ParseParamForActiveUnsubscriber(const napi_env &env, const std::stri
// argv[0] type: 'activate' | 'activating' // argv[0] type: 'activate' | 'activating'
if (type == "activate") { if (type == "activate") {
asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVED; asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATED;
} else { } else {
asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATING; asyncContext->osSubscribeType = OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATING;
} }

View File

@ -1910,7 +1910,7 @@ ErrCode IInnerOsAccountManager::SendMsgForAccountActivate(OsAccountInfo &osAccou
} }
if (oldId != localId) { if (oldId != localId) {
OsAccountInterface::SendToCESAccountSwitched(localId, oldId); OsAccountInterface::SendToCESAccountSwitched(localId, oldId);
subscribeManager_.Publish(localId, OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVED); subscribeManager_.Publish(localId, OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATED);
subscribeManager_.Publish(localId, oldId, OS_ACCOUNT_SUBSCRIBE_TYPE::SWITCHED); subscribeManager_.Publish(localId, oldId, OS_ACCOUNT_SUBSCRIBE_TYPE::SWITCHED);
ReportOsAccountSwitch(localId, oldId); ReportOsAccountSwitch(localId, oldId);
} }

View File

@ -187,8 +187,8 @@ HWTEST_F(OsAccountManagerServiceSubscribeModuleTest, OsAccountManagerServiceSubs
{ {
ACCOUNT_LOGI("OsAccountManagerServiceSubscribeModuleTest_0001"); ACCOUNT_LOGI("OsAccountManagerServiceSubscribeModuleTest_0001");
OsAccountSubscribeInfo osAccountSubscribeInfo; OsAccountSubscribeInfo osAccountSubscribeInfo;
osAccountSubscribeInfo.SetOsAccountSubscribeType(OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVED); osAccountSubscribeInfo.SetOsAccountSubscribeType(OS_ACCOUNT_SUBSCRIBE_TYPE::ACTIVATED);
osAccountSubscribeInfo.SetName("subscribeActive"); osAccountSubscribeInfo.SetName("subscribeActivated");
// make a subscriber // make a subscriber
auto subscriberTestPtr = std::make_shared<OsAccountSubscriberTest>(osAccountSubscribeInfo); auto subscriberTestPtr = std::make_shared<OsAccountSubscriberTest>(osAccountSubscribeInfo);