mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-23 07:10:19 +00:00
add user
Signed-off-by: unknown <sijunjie@huawei.com>
This commit is contained in:
parent
3b0f425248
commit
37fc217645
@ -97,15 +97,6 @@ ErrCode AbilityManagerClient::ScheduleCommandAbilityDone(const sptr<IRemoteObjec
|
||||
return abms->ScheduleCommandAbilityDone(token);
|
||||
}
|
||||
|
||||
void AbilityManagerClient::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
if (remoteObject_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
sptr<IAbilityManager> abms = iface_cast<IAbilityManager>(remoteObject_);
|
||||
abms->AddWindowInfo(token, windowToken);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::StartAbility(const Want &want, int32_t userId, int requestCode)
|
||||
{
|
||||
if (remoteObject_ == nullptr) {
|
||||
|
@ -113,9 +113,6 @@ int MockServiceAbilityManagerService::ScheduleCommandAbilityDone(const sptr<IRem
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MockServiceAbilityManagerService::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{}
|
||||
|
||||
int MockServiceAbilityManagerService::TerminateAbilityResult(const sptr<IRemoteObject> &token, int startId)
|
||||
{
|
||||
return 0;
|
||||
|
@ -72,8 +72,6 @@ public:
|
||||
int32_t userId = DEFAULT_INVAL_VALUE) override;
|
||||
int DisconnectAbility(const sptr<IAbilityConnection> &connect) override;
|
||||
|
||||
void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) override;
|
||||
|
||||
int AttachAbilityThread(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
int AbilityTransitionDone(const sptr<IRemoteObject> &token, int state, const PacMap &saveData) override;
|
||||
@ -108,11 +106,6 @@ public:
|
||||
MOCK_METHOD2(GetPendingRequestWant, int(const sptr<IWantSender> &target, std::shared_ptr<Want> &want));
|
||||
MOCK_METHOD5(StartAbility, int(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int32_t userId, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
ChangeFocusAbility, int(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken));
|
||||
MOCK_METHOD1(MinimizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(MaximizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(CloseMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(GetPendinTerminateAbilityTestgRequestWant, void(int id));
|
||||
MOCK_METHOD1(GetSystemMemoryAttr, void(AppExecFwk::SystemMemoryAttr &memoryInfo));
|
||||
MOCK_METHOD3(StartContinuation, int(const Want &want, const sptr<IRemoteObject> &abilityToken, int32_t status));
|
||||
@ -208,11 +201,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetAbilityRunningInfos(std::vector<AbilityRunningInfo> &info) override
|
||||
{
|
||||
return 0;
|
||||
|
@ -259,9 +259,6 @@ void Ability::OnStart(const Want &want)
|
||||
auto window = abilityWindow_->GetWindow();
|
||||
if (window) {
|
||||
auto windowId = window->GetWindowId();
|
||||
HILOG_INFO("Ability::OnStart: add windowId = %{public}d", windowId);
|
||||
OHOS::AAFwk::AbilityManagerClient::GetInstance()->AddWindowInfo(AbilityContext::GetToken(), windowId);
|
||||
|
||||
if (winType == Rosen::WindowType::WINDOW_TYPE_APP_MAIN_WINDOW) {
|
||||
HILOG_INFO("Call RegisterDisplayMoveListener, windowId: %{public}d", windowId);
|
||||
OHOS::sptr<OHOS::Rosen::IDisplayMoveListener> displayMoveListener(this);
|
||||
|
@ -69,11 +69,6 @@ ErrCode AbilityManagerClient::ScheduleCommandAbilityDone(const sptr<IRemoteObjec
|
||||
return -1;
|
||||
}
|
||||
|
||||
void AbilityManagerClient::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::StartAbility(const Want &want, int requestCode, int32_t userId)
|
||||
{
|
||||
return -1;
|
||||
|
@ -98,11 +98,6 @@ ErrCode AbilityManagerClient::ScheduleCommandAbilityDone(const sptr<IRemoteObjec
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
void AbilityManagerClient::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::TerminateAbility(const sptr<IRemoteObject> &token, int resultCode, const Want *resultWant)
|
||||
{
|
||||
return ERR_OK;
|
||||
@ -146,11 +141,6 @@ ErrCode AbilityManagerClient::StopServiceAbility(const Want &want)
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::KillProcess(const std::string &bundleName)
|
||||
{
|
||||
return ERR_OK;
|
||||
|
@ -97,15 +97,6 @@ ErrCode AbilityManagerClient::ScheduleCommandAbilityDone(const sptr<IRemoteObjec
|
||||
return abms->ScheduleCommandAbilityDone(token);
|
||||
}
|
||||
|
||||
void AbilityManagerClient::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
if (remoteObject_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
sptr<IAbilityManager> abms = iface_cast<IAbilityManager>(remoteObject_);
|
||||
abms->AddWindowInfo(token, windowToken);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::StartAbility(const Want &want, int requestCode, int32_t userId)
|
||||
{
|
||||
if (remoteObject_ == nullptr) {
|
||||
|
@ -137,9 +137,6 @@ int MockAbilityManagerService::ScheduleCommandAbilityDone(const sptr<IRemoteObje
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MockAbilityManagerService::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{}
|
||||
|
||||
int MockAbilityManagerService::TerminateAbilityResult(const sptr<IRemoteObject> &token, int startId)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "MockAbilityManagerService::TerminateAbilityResult";
|
||||
|
@ -70,8 +70,6 @@ public:
|
||||
|
||||
int DisconnectAbility(const sptr<IAbilityConnection> &connect) override;
|
||||
|
||||
void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) override;
|
||||
|
||||
int AttachAbilityThread(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
int AbilityTransitionDone(const sptr<IRemoteObject> &token, int state, const PacMap &saveData) override;
|
||||
@ -107,11 +105,6 @@ public:
|
||||
|
||||
MOCK_METHOD5(StartAbility, int(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int32_t userId, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
ChangeFocusAbility, int(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken));
|
||||
MOCK_METHOD1(MinimizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(MaximizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(CloseMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(GetPendinTerminateAbilityTestgRequestWant, void(int id));
|
||||
MOCK_METHOD1(GetSystemMemoryAttr, void(AppExecFwk::SystemMemoryAttr &memoryInfo));
|
||||
MOCK_METHOD3(StartContinuation, int(const Want &want, const sptr<IRemoteObject> &abilityToken, int32_t status));
|
||||
@ -157,11 +150,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int KillProcess(const std::string &bundleName) override;
|
||||
|
||||
int UninstallApp(const std::string &bundleName, int32_t uid) override;
|
||||
|
@ -94,11 +94,6 @@ ErrCode AbilityManagerClient::ScheduleCommandAbilityDone(const sptr<IRemoteObjec
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
void AbilityManagerClient::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::TerminateAbility(const sptr<IRemoteObject> &token, int resultCode, const Want *resultWant)
|
||||
{
|
||||
return ERR_OK;
|
||||
|
@ -34,7 +34,6 @@ public:
|
||||
MOCK_METHOD1(DisconnectAbility, int(const sptr<IAbilityConnection> &connect));
|
||||
MOCK_METHOD3(AcquireDataAbility, sptr<IAbilityScheduler>(const Uri &, bool, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(ReleaseDataAbility, int(sptr<IAbilityScheduler>, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(AddWindowInfo, void(const sptr<IRemoteObject> &token, int32_t windowToken));
|
||||
MOCK_METHOD2(AttachAbilityThread, int(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token));
|
||||
MOCK_METHOD3(AbilityTransitionDone, int(const sptr<IRemoteObject> &token, int state, const PacMap &saveData));
|
||||
MOCK_METHOD2(
|
||||
@ -51,7 +50,6 @@ public:
|
||||
MOCK_METHOD2(TerminateAbilityResult, int(const sptr<IRemoteObject> &, int startId));
|
||||
MOCK_METHOD2(TerminateAbilityByCaller, int(const sptr<IRemoteObject> &callerToken, int requestCode));
|
||||
MOCK_METHOD2(StopServiceAbility, int(const Want &, const sptr<IRemoteObject> &callerToken));
|
||||
MOCK_METHOD2(GetMissionSnapshot, int(const int32_t, MissionPixelMap &));
|
||||
MOCK_METHOD4(OnRemoteRequest, int(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
|
||||
|
||||
MOCK_METHOD1(KillProcess, int(const std::string &bundleName));
|
||||
|
@ -97,15 +97,6 @@ ErrCode AbilityManagerClient::ScheduleCommandAbilityDone(const sptr<IRemoteObjec
|
||||
return abms->ScheduleCommandAbilityDone(token);
|
||||
}
|
||||
|
||||
void AbilityManagerClient::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
if (remoteObject_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
sptr<IAbilityManager> abms = iface_cast<IAbilityManager>(remoteObject_);
|
||||
abms->AddWindowInfo(token, windowToken);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::StartAbility(const Want &want, int requestCode, int32_t userId)
|
||||
{
|
||||
if (remoteObject_ == nullptr) {
|
||||
|
@ -156,9 +156,6 @@ int MockAbilityManagerService::ScheduleCommandAbilityDone(const sptr<IRemoteObje
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MockAbilityManagerService::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{}
|
||||
|
||||
int MockAbilityManagerService::TerminateAbilityByCaller(const sptr<IRemoteObject> &callerToken, int requestCode)
|
||||
{
|
||||
return 0;
|
||||
@ -174,11 +171,6 @@ int MockAbilityManagerService::StopServiceAbility(const Want &want, int32_t user
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MockAbilityManagerService::GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
sptr<IAbilityScheduler> MockAbilityManagerService::AcquireDataAbility(
|
||||
const Uri &uri, bool tryBind, const sptr<IRemoteObject> &callerToken)
|
||||
{
|
||||
|
@ -71,8 +71,6 @@ public:
|
||||
|
||||
ErrCode ReleaseDataAbility(sptr<IAbilityScheduler> dataAbilityScheduler, const sptr<IRemoteObject> &callerToken);
|
||||
|
||||
void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) override;
|
||||
|
||||
int AttachAbilityThread(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
int AbilityTransitionDone(const sptr<IRemoteObject> &token, int state, const PacMap &saveData) override;
|
||||
@ -104,11 +102,6 @@ public:
|
||||
MOCK_METHOD1(GetSystemMemoryAttr, void(AppExecFwk::SystemMemoryAttr &memoryInfo));
|
||||
MOCK_METHOD5(StartAbility, int(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int32_t userId, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
ChangeFocusAbility, int(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken));
|
||||
MOCK_METHOD1(MinimizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(MaximizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(CloseMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(GetPendinTerminateAbilityTestgRequestWant, void(int id));
|
||||
MOCK_METHOD3(StartContinuation, int(const Want &want, const sptr<IRemoteObject> &abilityToken, int32_t status));
|
||||
MOCK_METHOD2(NotifyContinuationResult, int(int32_t missionId, int32_t result));
|
||||
@ -139,8 +132,6 @@ public:
|
||||
MOCK_METHOD0(BlockAmsService, int());
|
||||
MOCK_METHOD1(BlockAbility, int(int32_t abilityRecordId));
|
||||
|
||||
int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap) override;
|
||||
|
||||
int UpdateConfiguration(const AppExecFwk::Configuration &config)
|
||||
{
|
||||
return 0;
|
||||
|
@ -149,9 +149,6 @@ int MockServiceAbilityManagerService::ScheduleCommandAbilityDone(const sptr<IRem
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MockServiceAbilityManagerService::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{}
|
||||
|
||||
int MockServiceAbilityManagerService::TerminateAbilityResult(const sptr<IRemoteObject> &token, int startId)
|
||||
{
|
||||
return 0;
|
||||
|
@ -70,8 +70,6 @@ public:
|
||||
int32_t userId = DEFAULT_INVAL_VALUE) override;
|
||||
int DisconnectAbility(const sptr<IAbilityConnection> &connect) override;
|
||||
|
||||
void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) override;
|
||||
|
||||
int AttachAbilityThread(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token) override;
|
||||
|
||||
int AbilityTransitionDone(const sptr<IRemoteObject> &token, int state, const PacMap &saveData) override;
|
||||
@ -104,11 +102,6 @@ public:
|
||||
MOCK_METHOD2(GetPendingRequestWant, int(const sptr<IWantSender> &target, std::shared_ptr<Want> &want));
|
||||
MOCK_METHOD5(StartAbility, int(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int32_t userId, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
ChangeFocusAbility, int(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken));
|
||||
MOCK_METHOD1(MinimizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(MaximizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(CloseMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(GetPendinTerminateAbilityTestgRequestWant, void(int id));
|
||||
MOCK_METHOD1(GetSystemMemoryAttr, void(AppExecFwk::SystemMemoryAttr &memoryInfo));
|
||||
MOCK_METHOD3(StartContinuation, int(const Want &want, const sptr<IRemoteObject> &abilityToken, int32_t status));
|
||||
@ -157,11 +150,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
|
@ -83,14 +83,6 @@ public:
|
||||
*/
|
||||
ErrCode ScheduleCommandAbilityDone(const sptr<IRemoteObject> &token);
|
||||
|
||||
/**
|
||||
* AddWindowInfo, add windowToken to AbilityRecord.
|
||||
*
|
||||
* @param token, the token of the ability.
|
||||
* @param windowToken, window id of the ability.
|
||||
*/
|
||||
void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken);
|
||||
|
||||
/**
|
||||
* StartAbility with want, send want to ability manager service.
|
||||
*
|
||||
@ -323,35 +315,6 @@ public:
|
||||
|
||||
ErrCode GetWantSenderInfo(const sptr<IWantSender> &target, std::shared_ptr<WantSenderInfo> &info);
|
||||
|
||||
/**
|
||||
* minimize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
ErrCode MinimizeMultiWindow(int missionId);
|
||||
|
||||
/**
|
||||
* maximize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
ErrCode MaximizeMultiWindow(int missionId);
|
||||
|
||||
/**
|
||||
* Change the focus of ability in the mission stack.
|
||||
* @param lostToken, the token of lost focus ability
|
||||
* @param getToken, the token of get focus ability
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
ErrCode ChangeFocusAbility(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken);
|
||||
|
||||
/**
|
||||
* close multiwindow by mission id.
|
||||
* @param missionId, the id of target mission.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
ErrCode CloseMultiWindow(int missionId);
|
||||
|
||||
/**
|
||||
* Get system memory information.
|
||||
* @param SystemMemoryAttr, memory information.
|
||||
|
@ -214,14 +214,6 @@ public:
|
||||
virtual int ReleaseDataAbility(
|
||||
sptr<IAbilityScheduler> dataAbilityScheduler, const sptr<IRemoteObject> &callerToken) = 0;
|
||||
|
||||
/**
|
||||
* AddWindowInfo, add windowToken to AbilityRecord.
|
||||
*
|
||||
* @param token, the token of the ability.
|
||||
* @param windowToken, window id of the ability.
|
||||
*/
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) = 0;
|
||||
|
||||
/**
|
||||
* AttachAbilityThread, ability call this interface after loaded.
|
||||
*
|
||||
@ -297,14 +289,6 @@ public:
|
||||
*/
|
||||
virtual int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE) = 0;
|
||||
|
||||
/**
|
||||
* Get mission snapshot by mission id
|
||||
*
|
||||
* @param missionId the id of the mission to retrieve the sAutoapshots
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap) = 0;
|
||||
|
||||
/**
|
||||
* Kill the process immediately.
|
||||
*
|
||||
@ -340,36 +324,6 @@ public:
|
||||
*/
|
||||
virtual int UninstallApp(const std::string &bundleName, int32_t uid) = 0;
|
||||
|
||||
/**
|
||||
* Change the focus of ability in the mission stack.
|
||||
* @param lostToken, the token of lost focus ability
|
||||
* @param getToken, the token of get focus ability
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int ChangeFocusAbility(
|
||||
const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken) = 0;
|
||||
|
||||
/**
|
||||
* minimize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int MinimizeMultiWindow(int missionId) = 0;
|
||||
|
||||
/**
|
||||
* maximize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int MaximizeMultiWindow(int missionId) = 0;
|
||||
|
||||
/**
|
||||
* close multiwindow by mission id.
|
||||
* @param missionId, the id of target mission.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int CloseMultiWindow(int missionId) = 0;
|
||||
|
||||
/**
|
||||
* Updates the configuration by modifying the configuration.
|
||||
*
|
||||
|
@ -658,130 +658,6 @@ napi_value NAPI_ClearUpApplicationData(napi_env env, napi_callback_info info)
|
||||
return ((callBackMode) ? (nullptr) : (ret));
|
||||
}
|
||||
|
||||
auto NAPI_GetAbilityMissionSnapshotAsyncExecute = [](napi_env env, void *data) {
|
||||
HILOG_INFO("GetAbilityMissionSnapshotWrap called...");
|
||||
AsyncGetMissionSnapshot *async_callback_info = (AsyncGetMissionSnapshot *)data;
|
||||
AAFwk::AbilityManagerClient::GetInstance()->GetMissionSnapshot(async_callback_info->missionId,
|
||||
async_callback_info->missionSnapshot);
|
||||
};
|
||||
|
||||
auto NAPI_GetAbilityMissionSnapshotAsyncCompleteCallback = [](napi_env env, napi_status status, void *data) {
|
||||
HILOG_INFO("GetAbilityMissionSnapshotWrap compeleted(CallBack Mode)...");
|
||||
AsyncGetMissionSnapshot *async_callback_info = (AsyncGetMissionSnapshot *)data;
|
||||
napi_value result[2] = {0};
|
||||
napi_value callback;
|
||||
napi_value undefined;
|
||||
napi_value callResult = 0;
|
||||
|
||||
result[0] = GetCallbackErrorValue(async_callback_info->env, NapiAbilityMgr::BUSINESS_ERROR_CODE_OK);
|
||||
napi_create_object(async_callback_info->env, &result[1]);
|
||||
GetMissionSnapshotInfoForResult(
|
||||
async_callback_info->env, async_callback_info->missionSnapshot, result[1]);
|
||||
napi_get_undefined(env, &undefined);
|
||||
|
||||
napi_get_reference_value(env, async_callback_info->callback[0], &callback);
|
||||
napi_call_function(env, undefined, callback, 2, &result[0], &callResult);
|
||||
if (async_callback_info->callback[0] != nullptr) {
|
||||
napi_delete_reference(env, async_callback_info->callback[0]);
|
||||
}
|
||||
napi_delete_async_work(env, async_callback_info->asyncWork);
|
||||
delete async_callback_info;
|
||||
};
|
||||
|
||||
auto NAPI_GetAbilityMissionSnapshotPromiseCompleteCallback = [](napi_env env, napi_status status, void *data) {
|
||||
HILOG_INFO("GetAbilityMissionSnapshotWrap compeleted(Promise Mode)...");
|
||||
AsyncGetMissionSnapshot *async_callback_info = (AsyncGetMissionSnapshot *)data;
|
||||
napi_value result;
|
||||
napi_create_object(async_callback_info->env, &result);
|
||||
GetMissionSnapshotInfoForResult(async_callback_info->env, async_callback_info->missionSnapshot, result);
|
||||
napi_resolve_deferred(async_callback_info->env, async_callback_info->deferred, result);
|
||||
napi_delete_async_work(env, async_callback_info->asyncWork);
|
||||
delete async_callback_info;
|
||||
};
|
||||
|
||||
napi_value NAPI_GetAbilityMissionSnapshotWrap(
|
||||
napi_env env, napi_callback_info info, bool callBackMode, AsyncGetMissionSnapshot *async_callback_info)
|
||||
{
|
||||
HILOG_INFO("NAPI_GetAbilityMissionSnapshotWrap called...");
|
||||
if (callBackMode) {
|
||||
napi_value resourceName;
|
||||
napi_create_string_latin1(env, "NAPI_GetAbilityMissionSnapshotWrap", NAPI_AUTO_LENGTH, &resourceName);
|
||||
|
||||
napi_create_async_work(env,
|
||||
nullptr,
|
||||
resourceName,
|
||||
NAPI_GetAbilityMissionSnapshotAsyncExecute,
|
||||
NAPI_GetAbilityMissionSnapshotAsyncCompleteCallback,
|
||||
(void *)async_callback_info,
|
||||
&async_callback_info->asyncWork);
|
||||
|
||||
NAPI_CALL(env, napi_queue_async_work(env, async_callback_info->asyncWork));
|
||||
// create return
|
||||
napi_value ret = 0;
|
||||
NAPI_CALL(env, napi_create_int32(env, 0, &ret));
|
||||
return ret;
|
||||
} else {
|
||||
napi_value resourceName;
|
||||
napi_create_string_latin1(env, "NAPI_GetAbilityMissionSnapshotWrap", NAPI_AUTO_LENGTH, &resourceName);
|
||||
|
||||
napi_deferred deferred;
|
||||
napi_value promise;
|
||||
NAPI_CALL(env, napi_create_promise(env, &deferred, &promise));
|
||||
async_callback_info->deferred = deferred;
|
||||
|
||||
napi_create_async_work(env,
|
||||
nullptr,
|
||||
resourceName,
|
||||
NAPI_GetAbilityMissionSnapshotAsyncExecute,
|
||||
NAPI_GetAbilityMissionSnapshotPromiseCompleteCallback,
|
||||
(void *)async_callback_info,
|
||||
&async_callback_info->asyncWork);
|
||||
napi_queue_async_work(env, async_callback_info->asyncWork);
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
|
||||
napi_value NAPI_GetAbilityMissionSnapshot(napi_env env, napi_callback_info info)
|
||||
{
|
||||
size_t argc = 2;
|
||||
napi_value argv[NUMBER_OF_PARAMETERS_TWO];
|
||||
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, NULL, NULL));
|
||||
HILOG_INFO("argc = [%{public}d]", (int32_t)argc);
|
||||
|
||||
napi_valuetype valuetype0;
|
||||
NAPI_CALL(env, napi_typeof(env, argv[0], &valuetype0));
|
||||
NAPI_ASSERT(env, valuetype0 == napi_number, "Wrong argument type. Numbers expected.");
|
||||
int32_t missionId;
|
||||
NAPI_CALL(env, napi_get_value_int32(env, argv[0], &missionId));
|
||||
|
||||
bool callBackMode = false;
|
||||
if (argc >= 2) {
|
||||
napi_valuetype valuetype;
|
||||
NAPI_CALL(env, napi_typeof(env, argv[1], &valuetype));
|
||||
NAPI_ASSERT(env, valuetype == napi_function, "Wrong argument type. Function expected.");
|
||||
callBackMode = true;
|
||||
}
|
||||
|
||||
AsyncGetMissionSnapshot *async_callback_info =
|
||||
new (std::nothrow) AsyncGetMissionSnapshot {.env = env, .asyncWork = nullptr, .deferred = nullptr};
|
||||
if (async_callback_info == nullptr) {
|
||||
return NapiGetNull(env);
|
||||
}
|
||||
|
||||
async_callback_info->missionId = missionId;
|
||||
if (callBackMode) {
|
||||
napi_create_reference(env, argv[1], 1, &async_callback_info->callback[0]);
|
||||
}
|
||||
|
||||
napi_value ret = NAPI_GetAbilityMissionSnapshotWrap(env, info, callBackMode, async_callback_info);
|
||||
if (ret == nullptr) {
|
||||
delete async_callback_info;
|
||||
async_callback_info = nullptr;
|
||||
}
|
||||
|
||||
return ((callBackMode) ? (NapiGetNull(env)) : (ret));
|
||||
}
|
||||
|
||||
void CreateWeightReasonCodeObject(napi_env env, napi_value value)
|
||||
{
|
||||
napi_value nUnknow = nullptr;
|
||||
|
@ -80,15 +80,6 @@ struct AsyncClearUpApplicationDataCallbackInfo {
|
||||
int32_t result = -1;
|
||||
};
|
||||
|
||||
struct AsyncGetMissionSnapshot {
|
||||
napi_env env;
|
||||
napi_async_work asyncWork;
|
||||
napi_deferred deferred;
|
||||
napi_ref callback[2] = {0};
|
||||
int32_t missionId = -1;
|
||||
MissionSnapshot missionSnapshot;
|
||||
};
|
||||
|
||||
struct SystemMemroyInfoCB {
|
||||
std::shared_ptr<SystemMemoryAttr> info = nullptr;
|
||||
napi_async_work asyncWork = nullptr;
|
||||
@ -108,7 +99,6 @@ napi_value NAPI_GetAllRunningProcesses(napi_env env, napi_callback_info info);
|
||||
napi_value NAPI_GetActiveProcessInfos(napi_env env, napi_callback_info info);
|
||||
napi_value NAPI_KillProcessesByBundleName(napi_env env, napi_callback_info info);
|
||||
napi_value NAPI_ClearUpApplicationData(napi_env env, napi_callback_info info);
|
||||
napi_value NAPI_GetAbilityMissionSnapshot(napi_env env, napi_callback_info info);
|
||||
void CreateWeightReasonCodeObject(napi_env env, napi_value value);
|
||||
napi_value GetCallbackErrorValue(napi_env env, int errCode);
|
||||
napi_value NapiGetNull(napi_env env);
|
||||
|
@ -43,7 +43,6 @@ static napi_value Init(napi_env env, napi_value exports)
|
||||
DECLARE_NAPI_FUNCTION("getActiveProcessInfos", NAPI_GetActiveProcessInfos),
|
||||
DECLARE_NAPI_FUNCTION("killProcessesByBundleName", NAPI_KillProcessesByBundleName),
|
||||
DECLARE_NAPI_FUNCTION("clearUpApplicationData", NAPI_ClearUpApplicationData),
|
||||
DECLARE_NAPI_FUNCTION("getAbilityMissionSnapshot", NAPI_GetAbilityMissionSnapshot),
|
||||
DECLARE_NAPI_PROPERTY("WeightReasonCode", nWeightReasonCode),
|
||||
DECLARE_NAPI_FUNCTION("getSystemMemoryAttr", NAPI_GetSystemMemoryAttr),
|
||||
DECLARE_NAPI_FUNCTION("getAppMemorySize", NAPI_GetAppMemorySize),
|
||||
|
@ -57,7 +57,6 @@ abilityms_files = [
|
||||
"src/mission_stack.cpp",
|
||||
"src/mission_snapshot.cpp",
|
||||
"src/stack_setting.cpp",
|
||||
"src/lock_screen_event_subscriber.cpp",
|
||||
|
||||
# new ability manager service here
|
||||
"src/task_data_persistence_mgr.cpp",
|
||||
|
@ -180,14 +180,6 @@ public:
|
||||
virtual int ReleaseDataAbility(
|
||||
sptr<IAbilityScheduler> dataAbilityScheduler, const sptr<IRemoteObject> &callerToken) override;
|
||||
|
||||
/**
|
||||
* AddWindowInfo, add windowToken to AbilityRecord.
|
||||
*
|
||||
* @param token, the token of the ability.
|
||||
* @param windowToken, window id of the ability.
|
||||
*/
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) override;
|
||||
|
||||
/**
|
||||
* AttachAbilityThread, ability call this interface after loaded.
|
||||
*
|
||||
@ -263,14 +255,6 @@ public:
|
||||
*/
|
||||
virtual int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE) override;
|
||||
|
||||
/**
|
||||
* Get mission snapshot by mission id
|
||||
*
|
||||
* @param missionId the id of the mission to retrieve the sAutoapshots
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap) override;
|
||||
|
||||
/**
|
||||
* Kill the process immediately.
|
||||
*
|
||||
@ -306,36 +290,6 @@ public:
|
||||
*/
|
||||
virtual int UninstallApp(const std::string &bundleName, int32_t uid) override;
|
||||
|
||||
/**
|
||||
* Change the focus of ability in the mission stack.
|
||||
* @param lostToken, the token of lost focus ability
|
||||
* @param getToken, the token of get focus ability
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int ChangeFocusAbility(
|
||||
const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken) override;
|
||||
|
||||
/**
|
||||
* minimize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int MinimizeMultiWindow(int missionId) override;
|
||||
|
||||
/**
|
||||
* maximize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int MaximizeMultiWindow(int missionId) override;
|
||||
|
||||
/**
|
||||
* close multiwindow by mission id.
|
||||
* @param missionId, the id of target mission.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int CloseMultiWindow(int missionId) override;
|
||||
|
||||
/**
|
||||
* Updates the configuration by modifying the configuration.
|
||||
*
|
||||
|
@ -272,14 +272,6 @@ public:
|
||||
virtual int ReleaseDataAbility(
|
||||
sptr<IAbilityScheduler> dataAbilityScheduler, const sptr<IRemoteObject> &callerToken) override;
|
||||
|
||||
/**
|
||||
* AddWindowInfo, add windowToken to AbilityRecord.
|
||||
*
|
||||
* @param token, the token of the ability.
|
||||
* @param windowToken, window id of the ability.
|
||||
*/
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) override;
|
||||
|
||||
/**
|
||||
* AttachAbilityThread, ability call this interface after loaded.
|
||||
*
|
||||
@ -353,13 +345,6 @@ public:
|
||||
*/
|
||||
int Dump(int fd, const std::vector<std::u16string> &args) override;
|
||||
|
||||
/**
|
||||
* DumpWaittingAbilityQueue.
|
||||
*
|
||||
* @param result, result.
|
||||
*/
|
||||
void DumpWaittingAbilityQueue(std::string &result);
|
||||
|
||||
/**
|
||||
* dump ability stack info, about userID, mission stack info,
|
||||
* mission record info and ability info.
|
||||
@ -391,14 +376,6 @@ public:
|
||||
*/
|
||||
virtual int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE) override;
|
||||
|
||||
/**
|
||||
* Get mission snapshot by mission id
|
||||
*
|
||||
* @param missionId the id of the mission to retrieve the sAutoapshots
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap) override;
|
||||
|
||||
/**
|
||||
* Kill the process immediately.
|
||||
*
|
||||
@ -425,36 +402,6 @@ public:
|
||||
*/
|
||||
virtual int UninstallApp(const std::string &bundleName, int32_t uid) override;
|
||||
|
||||
/**
|
||||
* Change the focus of ability in the mission stack.
|
||||
* @param lostToken, the token of lost focus ability
|
||||
* @param getToken, the token of get focus ability
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int ChangeFocusAbility(
|
||||
const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken) override;
|
||||
|
||||
/**
|
||||
* minimize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int MinimizeMultiWindow(int missionId) override;
|
||||
|
||||
/**
|
||||
* maximize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int MaximizeMultiWindow(int missionId) override;
|
||||
|
||||
/**
|
||||
* close multiwindow by mission id.
|
||||
* @param missionId, the id of target mission.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
virtual int CloseMultiWindow(int missionId) override;
|
||||
|
||||
/**
|
||||
* Updates the configuration by modifying the configuration.
|
||||
*
|
||||
@ -574,7 +521,6 @@ public:
|
||||
void HandleForegroundNewTimeOut(int64_t eventId);
|
||||
void HandleBackgroundNewTimeOut(int64_t eventId);
|
||||
|
||||
void RestartAbility(const sptr<IRemoteObject> &token);
|
||||
void NotifyBmsAbilityLifeStatus(
|
||||
const std::string &bundleName, const std::string &abilityName, const int64_t launchTime, const int uid);
|
||||
|
||||
@ -586,8 +532,6 @@ public:
|
||||
int32_t userId = DEFAULT_INVAL_VALUE);
|
||||
|
||||
int CheckPermission(const std::string &bundleName, const std::string &permission);
|
||||
void UpdateLockScreenState(bool isLockScreen);
|
||||
|
||||
|
||||
void OnAcceptWantResponse(const AAFwk::Want &want, const std::string &flag);
|
||||
void OnStartSpecifiedAbilityTimeoutResponse(const AAFwk::Want &want);
|
||||
@ -914,9 +858,7 @@ private:
|
||||
int ReleaseRemoteAbility(const sptr<IRemoteObject> &connect, const AppExecFwk::ElementName &element);
|
||||
|
||||
void DumpInner(const std::string &args, std::vector<std::string> &info);
|
||||
void DumpStackInner(const std::string &args, std::vector<std::string> &info);
|
||||
void DumpMissionInner(const std::string &args, std::vector<std::string> &info);
|
||||
void DumpWaittingAbilityQueueInner(const std::string &args, std::vector<std::string> &info);
|
||||
void DumpStateInner(const std::string &args, std::vector<std::string> &info);
|
||||
void DataDumpStateInner(const std::string &args, std::vector<std::string> &info);
|
||||
void DumpMissionListInner(const std::string &args, std::vector<std::string> &info);
|
||||
|
@ -64,7 +64,6 @@ private:
|
||||
int AbilityTransitionDoneInner(MessageParcel &data, MessageParcel &reply);
|
||||
int ScheduleConnectAbilityDoneInner(MessageParcel &data, MessageParcel &reply);
|
||||
int ScheduleDisconnectAbilityDoneInner(MessageParcel &data, MessageParcel &reply);
|
||||
int AddWindowInfoInner(MessageParcel &data, MessageParcel &reply);
|
||||
int TerminateAbilityResultInner(MessageParcel &data, MessageParcel &reply);
|
||||
int ScheduleCommandAbilityDoneInner(MessageParcel &data, MessageParcel &reply);
|
||||
int GetMissionSnapshotInner(MessageParcel &data, MessageParcel &reply);
|
||||
@ -81,10 +80,6 @@ private:
|
||||
int DumpSysStateInner(MessageParcel &data, MessageParcel &reply);
|
||||
int StartAbilityForSettingsInner(MessageParcel &data, MessageParcel &reply);
|
||||
int StartAbilityForOptionsInner(MessageParcel &data, MessageParcel &reply);
|
||||
int ChangeFocusAbilityInner(MessageParcel &data, MessageParcel &reply);
|
||||
int MinimizeMultiWindowInner(MessageParcel &data, MessageParcel &reply);
|
||||
int MaximizeMultiWindowInner(MessageParcel &data, MessageParcel &reply);
|
||||
int CloseMultiWindowInner(MessageParcel &data, MessageParcel &reply);
|
||||
int UpdateConfigurationInner(MessageParcel &data, MessageParcel &reply);
|
||||
|
||||
int GetWantSenderInner(MessageParcel &data, MessageParcel &reply);
|
||||
|
@ -601,12 +601,6 @@ public:
|
||||
*/
|
||||
bool IsConnectListEmpty();
|
||||
|
||||
/**
|
||||
* add ability's window info to record.
|
||||
*
|
||||
*/
|
||||
void AddWindowInfo(int windowToken);
|
||||
|
||||
/**
|
||||
* remove ability's window info from record.
|
||||
*
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "mission_record.h"
|
||||
#include "mission_snapshot.h"
|
||||
#include "mission_stack.h"
|
||||
#include "lock_screen_event_subscriber.h"
|
||||
#include "want.h"
|
||||
#include "screenshot_handler.h"
|
||||
|
||||
@ -210,14 +209,6 @@ public:
|
||||
*/
|
||||
int AbilityTransitionDone(const sptr<IRemoteObject> &token, int state, const PacMap &saveData);
|
||||
|
||||
/**
|
||||
* AddWindowInfo, add windowToken to AbilityRecord.
|
||||
*
|
||||
* @param token, the token of the ability.
|
||||
* @param windowToken, window id of the ability.
|
||||
*/
|
||||
void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken);
|
||||
|
||||
/**
|
||||
* OnAbilityRequestDone, app manager service call this interface after ability request done.
|
||||
*
|
||||
@ -266,7 +257,6 @@ public:
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
void Dump(std::vector<std::string> &info);
|
||||
void DumpWaittingAbilityQueue(std::string &result);
|
||||
void DumpTopAbility(std::vector<std::string> &info);
|
||||
void DumpMission(int missionId, std::vector<std::string> &info);
|
||||
void DumpStack(int missionStackId, std::vector<std::string> &info);
|
||||
@ -301,44 +291,10 @@ public:
|
||||
bool IsFrontInAllStack(const std::shared_ptr<MissionStack> &stack) const;
|
||||
bool IsTopInMission(const std::shared_ptr<AbilityRecord> &abilityRecord) const;
|
||||
|
||||
/**
|
||||
* minimize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
int MinimizeMultiWindow(int missionId);
|
||||
/**
|
||||
* maximize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
int MaximizeMultiWindow(int missionId);
|
||||
|
||||
/**
|
||||
* Change the focus of ability in the mission stack.
|
||||
* @param lostToken, the token of lost focus ability
|
||||
* @param getToken, the token of get focus ability
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
int ChangeFocusAbility(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken);
|
||||
|
||||
/**
|
||||
* close multiwindow by mission id.
|
||||
* @param missionId, the id of target mission.
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
int CloseMultiWindow(int missionId);
|
||||
|
||||
void JudgingIsRemoveMultiScreenStack(std::shared_ptr<MissionStack> &stack);
|
||||
|
||||
int StartLockMission(int uid, int missionId, bool isSystemApp, int isLock);
|
||||
|
||||
void RestartAbility(const std::shared_ptr<AbilityRecord> abilityRecord);
|
||||
|
||||
int GetMissionSnapshot(int32_t missionId, MissionPixelMap &missionPixelMap);
|
||||
|
||||
void UpdateLockScreenState(bool isLockScreen);
|
||||
|
||||
bool IsStarted();
|
||||
void PauseManager();
|
||||
void ResumeManager();
|
||||
@ -552,14 +508,6 @@ private:
|
||||
std::shared_ptr<AbilityRecord> lastTopAbility, std::shared_ptr<AbilityRecord> targetAbility,
|
||||
std::shared_ptr<AbilityRecord> &needBackgroundAbility);
|
||||
|
||||
/**
|
||||
* minimize multiwindow by mission id.
|
||||
* @param missionId, the id of target mission
|
||||
* @return Returns ERR_OK on success, others on failure.
|
||||
*/
|
||||
int MinimizeMultiWindowLocked(int missionId);
|
||||
int ChangeFocusAbilityLocked(const std::shared_ptr<AbilityRecord> &targetAbility);
|
||||
|
||||
void NotifyWindowModeChanged(const SystemWindowMode &windowMode);
|
||||
|
||||
void UpdateFocusAbilityRecord(
|
||||
@ -615,7 +563,6 @@ private:
|
||||
// find AbilityRecord by windowToken. one windowToken has one and only one AbilityRecord.
|
||||
std::unordered_map<int, std::shared_ptr<AbilityRecord>> windowTokenToAbilityMap_;
|
||||
SystemWindowMode curSysWindowMode_ = SystemWindowMode::DEFAULT_WINDOW_MODE;
|
||||
bool isMultiWinMoving_ = false;
|
||||
std::vector<StackSetting> stackSettings_;
|
||||
std::map<int, std::weak_ptr<AbilityRecord>> focusAbilityRecordMap_; // abilities has been focused ,
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
@ -623,7 +570,6 @@ private:
|
||||
#endif
|
||||
static int64_t splitScreenStackId;
|
||||
const static std::map<SystemWindowMode, std::string> windowModeToStrMap_;
|
||||
std::shared_ptr<LockScreenEventSubscriber> subscriber_ = nullptr;
|
||||
bool isLockScreen_ = false;
|
||||
};
|
||||
} // namespace AAFwk
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef OHOS_AAFWK_LOCK_SCREEN_EVENT_SUBSCRIBER_H
|
||||
#define OHOS_AAFWK_LOCK_SCREEN_EVENT_SUBSCRIBER_H
|
||||
|
||||
#include <mutex>
|
||||
#include <stdint.h>
|
||||
#include "ability_event_handler.h"
|
||||
#include "common_event.h"
|
||||
#include "common_event_manager.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AAFwk {
|
||||
class LockScreenEventSubscriber : public EventFwk::CommonEventSubscriber {
|
||||
public:
|
||||
explicit LockScreenEventSubscriber(const EventFwk::CommonEventSubscribeInfo &sp,
|
||||
const std::shared_ptr<AbilityEventHandler> &handler): EventFwk::CommonEventSubscriber(sp), handler_(handler)
|
||||
{}
|
||||
virtual ~LockScreenEventSubscriber()
|
||||
{}
|
||||
virtual void OnReceiveEvent(const EventFwk::CommonEventData &data) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<AbilityEventHandler> handler_;
|
||||
};
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
#endif // OHOS_AAFWK_LOCK_SCREEN_EVENT_SUBSCRIBER_H
|
@ -96,13 +96,6 @@ ErrCode AbilityManagerClient::ScheduleCommandAbilityDone(const sptr<IRemoteObjec
|
||||
return abms->ScheduleCommandAbilityDone(token);
|
||||
}
|
||||
|
||||
void AbilityManagerClient::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
auto abms = GetAbilityManager();
|
||||
CHECK_POINTER_RETURN(abms);
|
||||
abms->AddWindowInfo(token, windowToken);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::StartAbility(const Want &want, int requestCode, int32_t userId)
|
||||
{
|
||||
auto abms = GetAbilityManager();
|
||||
@ -267,47 +260,6 @@ ErrCode AbilityManagerClient::StopServiceAbility(const Want &want)
|
||||
return abms->StopServiceAbility(want);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::GetMissionSnapshot(const int32_t missionId, MissionSnapshot &missionSnapshot)
|
||||
{
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
auto abms = GetAbilityManager();
|
||||
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
|
||||
MissionPixelMap missionPixelMap;
|
||||
int ret = abms->GetMissionSnapshot(missionId, missionPixelMap);
|
||||
if (ret == ERR_OK) {
|
||||
HILOG_INFO("missionPixelMap.imageInfo.shmKey: %{public}d", missionPixelMap.imageInfo.shmKey);
|
||||
if (missionPixelMap.imageInfo.size == 0) {
|
||||
HILOG_INFO("size is 0.");
|
||||
return -1;
|
||||
}
|
||||
void *data = SharedMemory::PopSharedMemory(missionPixelMap.imageInfo.shmKey, missionPixelMap.imageInfo.size);
|
||||
if (!data) {
|
||||
HILOG_INFO("SharedMemory::PopSharedMemory return value is nullptr.");
|
||||
return -1;
|
||||
}
|
||||
Media::InitializationOptions mediaOption;
|
||||
mediaOption.size.width = (int)missionPixelMap.imageInfo.width;
|
||||
mediaOption.size.height = (int)missionPixelMap.imageInfo.height;
|
||||
mediaOption.pixelFormat = Media::PixelFormat::BGRA_8888;
|
||||
mediaOption.editable = true;
|
||||
auto pixel = Media::PixelMap::Create((const uint32_t *)data,
|
||||
missionPixelMap.imageInfo.size / sizeof(uint32_t), mediaOption);
|
||||
if (!pixel) {
|
||||
HILOG_INFO(" Media::PixelMap::Create return value is nullptr.");
|
||||
return -1;
|
||||
}
|
||||
HILOG_INFO("width = [%{public}d]", pixel->GetWidth());
|
||||
HILOG_INFO("height = [%{public}d]", pixel->GetHeight());
|
||||
HILOG_INFO("size = [%{public}d]", missionPixelMap.imageInfo.size);
|
||||
missionSnapshot.topAbility = missionPixelMap.topAbility;
|
||||
missionSnapshot.snapshot = std::move(pixel);
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::KillProcess(const std::string &bundleName)
|
||||
{
|
||||
HILOG_INFO("[%{public}s(%{public}s)] enter", __FILE__, __FUNCTION__);
|
||||
@ -331,35 +283,6 @@ ErrCode AbilityManagerClient::ClearUpApplicationData(const std::string &bundleNa
|
||||
return abms->ClearUpApplicationData(bundleName);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
auto abms = GetAbilityManager();
|
||||
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
|
||||
return abms->MinimizeMultiWindow(missionId);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
auto abms = GetAbilityManager();
|
||||
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
|
||||
return abms->MaximizeMultiWindow(missionId);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::ChangeFocusAbility(
|
||||
const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
auto abms = GetAbilityManager();
|
||||
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
|
||||
return abms->ChangeFocusAbility(lostFocusToken, getFocusToken);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::CloseMultiWindow(int missionId)
|
||||
{
|
||||
auto abms = GetAbilityManager();
|
||||
CHECK_POINTER_RETURN_NOT_CONNECTED(abms);
|
||||
return abms->CloseMultiWindow(missionId);
|
||||
}
|
||||
|
||||
ErrCode AbilityManagerClient::UpdateConfiguration(const AppExecFwk::Configuration &config)
|
||||
{
|
||||
auto abms = GetAbilityManager();
|
||||
|
@ -555,26 +555,6 @@ int AbilityManagerProxy::ScheduleCommandAbilityDone(const sptr<IRemoteObject> &t
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
void AbilityManagerProxy::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
int error;
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
return;
|
||||
}
|
||||
if (!data.WriteRemoteObject(token) || !data.WriteInt32(windowToken)) {
|
||||
HILOG_ERROR("data write failed.");
|
||||
return;
|
||||
}
|
||||
error = Remote()->SendRequest(ADD_WINDOW_INFO, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
HILOG_ERROR("Send request error: %{public}d", error);
|
||||
}
|
||||
}
|
||||
|
||||
void AbilityManagerProxy::DumpSysState(
|
||||
const std::string& args, std::vector<std::string>& state, bool isClient, bool isUserId, int UserId)
|
||||
{
|
||||
@ -724,34 +704,6 @@ int AbilityManagerProxy::GetParcelableInfos(MessageParcel &reply, std::vector<T>
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
int error;
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
return INNER_ERR;
|
||||
}
|
||||
if (!data.WriteInt32(missionId)) {
|
||||
HILOG_ERROR("missionId write failed.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
error = Remote()->SendRequest(IAbilityManager::GET_MISSION_SNAPSHOT, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
HILOG_ERROR("Send request error: %{public}d", error);
|
||||
return error;
|
||||
}
|
||||
std::unique_ptr<MissionPixelMap> info(reply.ReadParcelable<MissionPixelMap>());
|
||||
if (!info) {
|
||||
HILOG_ERROR("readParcelableInfo failed.");
|
||||
return ERR_UNKNOWN_OBJECT;
|
||||
}
|
||||
missionPixelMap = *info;
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::GetMissionSnapshot(const std::string& deviceId, int32_t missionId, MissionSnapshot& snapshot)
|
||||
{
|
||||
int error;
|
||||
@ -876,91 +828,6 @@ int AbilityManagerProxy::UninstallApp(const std::string &bundleName, int32_t uid
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::ChangeFocusAbility(
|
||||
const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
return INNER_ERR;
|
||||
}
|
||||
if (!data.WriteRemoteObject(lostFocusToken) || !data.WriteRemoteObject(getFocusToken)) {
|
||||
HILOG_ERROR("change focus ability failed");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
auto error = Remote()->SendRequest(IAbilityManager::CHANGE_FOCUS_ABILITY, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
HILOG_ERROR("change focus ability error: %d", error);
|
||||
return error;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
return INNER_ERR;
|
||||
}
|
||||
if (!data.WriteInt32(missionId)) {
|
||||
HILOG_ERROR("WriteInt32 fail.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
auto error = Remote()->SendRequest(IAbilityManager::MINIMIZE_MULTI_WINDOW, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
HILOG_ERROR("minimize multi window error: %d", error);
|
||||
return error;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
return INNER_ERR;
|
||||
}
|
||||
if (!data.WriteInt32(missionId)) {
|
||||
HILOG_ERROR("WriteInt32 fail.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
auto error = Remote()->SendRequest(IAbilityManager::MAXIMIZE_MULTI_WINDOW, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
HILOG_ERROR("maximize multi window error: %d", error);
|
||||
return error;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::CloseMultiWindow(int missionId)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
MessageOption option;
|
||||
|
||||
if (!WriteInterfaceToken(data)) {
|
||||
return INNER_ERR;
|
||||
}
|
||||
if (!data.WriteInt32(missionId)) {
|
||||
HILOG_ERROR("WriteInt32 fail.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
auto error = Remote()->SendRequest(IAbilityManager::CLOSE_MULTI_WINDOW, data, reply, option);
|
||||
if (error != NO_ERROR) {
|
||||
HILOG_ERROR("close multi window error: %d", error);
|
||||
return error;
|
||||
}
|
||||
return reply.ReadInt32();
|
||||
}
|
||||
|
||||
int AbilityManagerProxy::UpdateConfiguration(const AppExecFwk::Configuration &config)
|
||||
{
|
||||
int error;
|
||||
|
@ -790,15 +790,6 @@ int AbilityManagerService::MinimizeAbility(const sptr<IRemoteObject> &token, boo
|
||||
return missionListManager->MinimizeAbility(token, fromUser);
|
||||
}
|
||||
|
||||
int AbilityManagerService::GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
if (missionId < 0) {
|
||||
HILOG_ERROR("GetMissionSnapshot failed.");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
return currentStackManager_->GetMissionSnapshot(missionId, missionPixelMap);
|
||||
}
|
||||
|
||||
int AbilityManagerService::UpdateConfiguration(const AppExecFwk::Configuration &config)
|
||||
{
|
||||
HILOG_INFO("%{public}s called", __func__);
|
||||
@ -1615,9 +1606,7 @@ int AbilityManagerService::AttachAbilityThread(
|
||||
void AbilityManagerService::DumpFuncInit()
|
||||
{
|
||||
dumpFuncMap_[KEY_DUMP_ALL] = &AbilityManagerService::DumpInner;
|
||||
dumpFuncMap_[KEY_DUMP_STACK] = &AbilityManagerService::DumpStackInner;
|
||||
dumpFuncMap_[KEY_DUMP_MISSION] = &AbilityManagerService::DumpMissionInner;
|
||||
dumpFuncMap_[KEY_DUMP_WAIT_QUEUE] = &AbilityManagerService::DumpWaittingAbilityQueueInner;
|
||||
dumpFuncMap_[KEY_DUMP_SERVICE] = &AbilityManagerService::DumpStateInner;
|
||||
dumpFuncMap_[KEY_DUMP_DATA] = &AbilityManagerService::DataDumpStateInner;
|
||||
dumpFuncMap_[KEY_DUMP_MISSION_LIST] = &AbilityManagerService::DumpMissionListInner;
|
||||
@ -1878,22 +1867,6 @@ void AbilityManagerService::DumpMissionInfosInner(const std::string &args, std::
|
||||
}
|
||||
}
|
||||
|
||||
void AbilityManagerService::DumpStackInner(const std::string &args, std::vector<std::string> &info)
|
||||
{
|
||||
std::vector<std::string> argList;
|
||||
SplitStr(args, " ", argList);
|
||||
if (argList.empty()) {
|
||||
return;
|
||||
}
|
||||
if (argList.size() < MIN_DUMP_ARGUMENT_NUM) {
|
||||
info.push_back("error: invalid argument, please see 'ability dump -h'.");
|
||||
return;
|
||||
}
|
||||
int stackId = DEFAULT_INVAL_VALUE;
|
||||
(void)StrToInt(argList[1], stackId);
|
||||
currentStackManager_->DumpStack(stackId, info);
|
||||
}
|
||||
|
||||
void AbilityManagerService::DumpMissionInner(const std::string &args, std::vector<std::string> &info)
|
||||
{
|
||||
std::vector<std::string> argList;
|
||||
@ -1910,13 +1883,6 @@ void AbilityManagerService::DumpMissionInner(const std::string &args, std::vecto
|
||||
currentMissionListManager_->DumpMission(missionId, info);
|
||||
}
|
||||
|
||||
void AbilityManagerService::DumpWaittingAbilityQueueInner(const std::string &args, std::vector<std::string> &info)
|
||||
{
|
||||
std::string result;
|
||||
DumpWaittingAbilityQueue(result);
|
||||
info.push_back(result);
|
||||
}
|
||||
|
||||
void AbilityManagerService::DumpStateInner(const std::string &args, std::vector<std::string> &info)
|
||||
{
|
||||
std::vector<std::string> argList;
|
||||
@ -2137,23 +2103,6 @@ int AbilityManagerService::ScheduleCommandAbilityDone(const sptr<IRemoteObject>
|
||||
return connectManager->ScheduleCommandAbilityDoneLocked(token);
|
||||
}
|
||||
|
||||
void AbilityManagerService::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
HILOG_DEBUG("Add window id.");
|
||||
if (!VerificationAllToken(token)) {
|
||||
return;
|
||||
}
|
||||
auto abilityRecord = Token::GetAbilityRecordByToken(token);
|
||||
CHECK_POINTER(abilityRecord);
|
||||
auto userId = abilityRecord->GetApplicationInfo().uid / BASE_USER_RANGE;
|
||||
auto stackManager = currentStackManager_;
|
||||
if (!stackManager) {
|
||||
HILOG_ERROR("stackManager is nullptr. userId=%{public}d", userId);
|
||||
return ;
|
||||
}
|
||||
stackManager->AddWindowInfo(token, windowToken);
|
||||
}
|
||||
|
||||
void AbilityManagerService::OnAbilityRequestDone(const sptr<IRemoteObject> &token, const int32_t state)
|
||||
{
|
||||
BYTRACE_NAME(BYTRACE_TAG_ABILITY_MANAGER, __PRETTY_FUNCTION__);
|
||||
@ -2239,12 +2188,6 @@ std::shared_ptr<AbilityStackManager> AbilityManagerService::GetStackManager()
|
||||
return currentStackManager_;
|
||||
}
|
||||
|
||||
void AbilityManagerService::DumpWaittingAbilityQueue(std::string &result)
|
||||
{
|
||||
currentStackManager_->DumpWaittingAbilityQueue(result);
|
||||
return;
|
||||
}
|
||||
|
||||
// multi user scene
|
||||
int AbilityManagerService::GetUserId()
|
||||
{
|
||||
@ -2858,44 +2801,6 @@ std::shared_ptr<DataAbilityManager> AbilityManagerService::GetDataAbilityManager
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int AbilityManagerService::ChangeFocusAbility(
|
||||
const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
HILOG_INFO("Change focus ability.");
|
||||
CHECK_POINTER_AND_RETURN(lostFocusToken, ERR_INVALID_VALUE);
|
||||
CHECK_POINTER_AND_RETURN(getFocusToken, ERR_INVALID_VALUE);
|
||||
CHECK_POINTER_AND_RETURN(currentStackManager_, ERR_INVALID_VALUE);
|
||||
|
||||
if (!VerificationAllToken(lostFocusToken)) {
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (!VerificationAllToken(getFocusToken)) {
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
return currentStackManager_->ChangeFocusAbility(lostFocusToken, getFocusToken);
|
||||
}
|
||||
|
||||
int AbilityManagerService::MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
HILOG_INFO("Minimize multi window.");
|
||||
return currentStackManager_->MinimizeMultiWindow(missionId);
|
||||
}
|
||||
|
||||
int AbilityManagerService::MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
HILOG_INFO("Maximize multi window.");
|
||||
return currentStackManager_->MaximizeMultiWindow(missionId);
|
||||
}
|
||||
|
||||
int AbilityManagerService::CloseMultiWindow(int missionId)
|
||||
{
|
||||
HILOG_INFO("Close multi window.");
|
||||
CHECK_POINTER_AND_RETURN(currentStackManager_, ERR_INVALID_VALUE);
|
||||
return currentStackManager_->CloseMultiWindow(missionId);
|
||||
}
|
||||
|
||||
int AbilityManagerService::GetUidByBundleName(std::string bundleName)
|
||||
{
|
||||
auto bms = GetBundleManager();
|
||||
@ -2903,26 +2808,6 @@ int AbilityManagerService::GetUidByBundleName(std::string bundleName)
|
||||
return IN_PROCESS_CALL(bms->GetUidByBundleName(bundleName, GetUserId()));
|
||||
}
|
||||
|
||||
void AbilityManagerService::RestartAbility(const sptr<IRemoteObject> &token)
|
||||
{
|
||||
HILOG_INFO("%{public}s called", __func__);
|
||||
CHECK_POINTER(currentStackManager_);
|
||||
if (!VerificationAllToken(token)) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto abilityRecord = Token::GetAbilityRecordByToken(token);
|
||||
CHECK_POINTER(abilityRecord);
|
||||
auto userId = abilityRecord->GetApplicationInfo().uid / BASE_USER_RANGE;
|
||||
|
||||
auto stackManager = currentStackManager_;
|
||||
if (!stackManager) {
|
||||
HILOG_ERROR("stackManager is nullptr. userId=%{public}d", userId);
|
||||
return;
|
||||
}
|
||||
stackManager->RestartAbility(abilityRecord);
|
||||
}
|
||||
|
||||
void AbilityManagerService::NotifyBmsAbilityLifeStatus(
|
||||
const std::string &bundleName, const std::string &abilityName, const int64_t launchTime, const int uid)
|
||||
{
|
||||
@ -3017,13 +2902,6 @@ int AbilityManagerService::GetWantSenderInfo(const sptr<IWantSender> &target, st
|
||||
return pendingWantManager_->GetWantSenderInfo(target, info);
|
||||
}
|
||||
|
||||
void AbilityManagerService::UpdateLockScreenState(bool isLockScreen)
|
||||
{
|
||||
HILOG_DEBUG("%{public}s begin", __func__);
|
||||
CHECK_POINTER(currentStackManager_);
|
||||
currentStackManager_->UpdateLockScreenState(isLockScreen);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get system memory information.
|
||||
* @param SystemMemoryAttr, memory information.
|
||||
|
@ -48,10 +48,8 @@ void AbilityManagerStub::FirstStepInit()
|
||||
requestFuncMap_[ABILITY_TRANSITION_DONE] = &AbilityManagerStub::AbilityTransitionDoneInner;
|
||||
requestFuncMap_[CONNECT_ABILITY_DONE] = &AbilityManagerStub::ScheduleConnectAbilityDoneInner;
|
||||
requestFuncMap_[DISCONNECT_ABILITY_DONE] = &AbilityManagerStub::ScheduleDisconnectAbilityDoneInner;
|
||||
requestFuncMap_[ADD_WINDOW_INFO] = &AbilityManagerStub::AddWindowInfoInner;
|
||||
requestFuncMap_[TERMINATE_ABILITY_RESULT] = &AbilityManagerStub::TerminateAbilityResultInner;
|
||||
requestFuncMap_[COMMAND_ABILITY_DONE] = &AbilityManagerStub::ScheduleCommandAbilityDoneInner;
|
||||
requestFuncMap_[GET_MISSION_SNAPSHOT] = &AbilityManagerStub::GetMissionSnapshotInner;
|
||||
requestFuncMap_[ACQUIRE_DATA_ABILITY] = &AbilityManagerStub::AcquireDataAbilityInner;
|
||||
requestFuncMap_[RELEASE_DATA_ABILITY] = &AbilityManagerStub::ReleaseDataAbilityInner;
|
||||
requestFuncMap_[KILL_PROCESS] = &AbilityManagerStub::KillProcessInner;
|
||||
@ -71,8 +69,6 @@ void AbilityManagerStub::FirstStepInit()
|
||||
requestFuncMap_[NOTIFY_CONTINUATION_RESULT] = &AbilityManagerStub::NotifyContinuationResultInner;
|
||||
requestFuncMap_[REGISTER_REMOTE_MISSION_LISTENER] = &AbilityManagerStub::RegisterRemoteMissionListenerInner;
|
||||
requestFuncMap_[UNREGISTER_REMOTE_MISSION_LISTENER] = &AbilityManagerStub::UnRegisterRemoteMissionListenerInner;
|
||||
requestFuncMap_[CHANGE_FOCUS_ABILITY] = &AbilityManagerStub::ChangeFocusAbilityInner;
|
||||
requestFuncMap_[MINIMIZE_MULTI_WINDOW] = &AbilityManagerStub::MinimizeMultiWindowInner;
|
||||
requestFuncMap_[START_ABILITY_FOR_OPTIONS] = &AbilityManagerStub::StartAbilityForOptionsInner;
|
||||
requestFuncMap_[START_SYNC_MISSIONS] = &AbilityManagerStub::StartSyncRemoteMissionsInner;
|
||||
requestFuncMap_[STOP_SYNC_MISSIONS] = &AbilityManagerStub::StopSyncRemoteMissionsInner;
|
||||
@ -81,8 +77,6 @@ void AbilityManagerStub::FirstStepInit()
|
||||
|
||||
void AbilityManagerStub::SecondStepInit()
|
||||
{
|
||||
requestFuncMap_[MAXIMIZE_MULTI_WINDOW] = &AbilityManagerStub::MaximizeMultiWindowInner;
|
||||
requestFuncMap_[CLOSE_MULTI_WINDOW] = &AbilityManagerStub::CloseMultiWindowInner;
|
||||
requestFuncMap_[GET_PENDING_WANT_SENDER] = &AbilityManagerStub::GetWantSenderInner;
|
||||
requestFuncMap_[SEND_PENDING_WANT_SENDER] = &AbilityManagerStub::SendWantSenderInner;
|
||||
requestFuncMap_[CANCEL_PENDING_WANT_SENDER] = &AbilityManagerStub::CancelWantSenderInner;
|
||||
@ -249,14 +243,6 @@ int AbilityManagerStub::ScheduleDisconnectAbilityDoneInner(MessageParcel &data,
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::AddWindowInfoInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
sptr<IRemoteObject> token = data.ReadRemoteObject();
|
||||
int windowToken = data.ReadInt32();
|
||||
AddWindowInfo(token, windowToken);
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::TerminateAbilityResultInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
sptr<IRemoteObject> token = data.ReadRemoteObject();
|
||||
@ -274,23 +260,6 @@ int AbilityManagerStub::ScheduleCommandAbilityDoneInner(MessageParcel &data, Mes
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::GetMissionSnapshotInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
MissionPixelMap missionPixelMap;
|
||||
int32_t missionId = data.ReadInt32();
|
||||
int32_t result = GetMissionSnapshot(missionId, missionPixelMap);
|
||||
if (!reply.WriteParcelable(&missionPixelMap)) {
|
||||
HILOG_ERROR("GetMissionSnapshot error");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
if (!reply.WriteInt32(result)) {
|
||||
HILOG_ERROR("GetMissionSnapshot result error");
|
||||
return ERR_INVALID_VALUE;
|
||||
}
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::AcquireDataAbilityInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
std::unique_ptr<Uri> uri(new Uri(data.ReadString()));
|
||||
@ -521,39 +490,6 @@ int AbilityManagerStub::StartAbilityForOptionsInner(MessageParcel &data, Message
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::ChangeFocusAbilityInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
auto loseToken = data.ReadRemoteObject();
|
||||
auto getToken = data.ReadRemoteObject();
|
||||
auto result = ChangeFocusAbility(loseToken, getToken);
|
||||
reply.WriteInt32(result);
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::MinimizeMultiWindowInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
auto missionId = data.ReadInt32();
|
||||
auto result = MinimizeMultiWindow(missionId);
|
||||
reply.WriteInt32(result);
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::MaximizeMultiWindowInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
auto missionId = data.ReadInt32();
|
||||
auto result = MaximizeMultiWindow(missionId);
|
||||
reply.WriteInt32(result);
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::CloseMultiWindowInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
auto missionId = data.ReadInt32();
|
||||
auto result = CloseMultiWindow(missionId);
|
||||
reply.WriteInt32(result);
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int AbilityManagerStub::UpdateConfigurationInner(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
std::unique_ptr<AppExecFwk::Configuration> config(data.ReadParcelable<AppExecFwk::Configuration>());
|
||||
|
@ -810,17 +810,6 @@ std::shared_ptr<AbilityRecord> AbilityRecord::GetCallerRecord() const
|
||||
return callerList_.back()->GetCaller();
|
||||
}
|
||||
|
||||
void AbilityRecord::AddWindowInfo(int windowToken)
|
||||
{
|
||||
windowInfo_ = std::make_shared<WindowInfo>(windowToken);
|
||||
isWindowAttached_ = true;
|
||||
}
|
||||
|
||||
void AbilityRecord::RemoveWindowInfo()
|
||||
{
|
||||
windowInfo_.reset();
|
||||
}
|
||||
|
||||
bool AbilityRecord::IsConnectListEmpty()
|
||||
{
|
||||
return connRecordList_.empty();
|
||||
|
@ -1003,36 +1003,6 @@ int AbilityStackManager::DispatchTerminate(const std::shared_ptr<AbilityRecord>
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
void AbilityStackManager::AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
HILOG_DEBUG("Add window id.");
|
||||
std::lock_guard<std::recursive_mutex> guard(stackLock_);
|
||||
// create WindowInfo and add to its AbilityRecord
|
||||
auto abilityRecord = GetAbilityRecordByToken(token);
|
||||
CHECK_POINTER(abilityRecord);
|
||||
if (abilityRecord->GetWindowInfo()) {
|
||||
HILOG_DEBUG("WindowInfo is already added. Can't add again.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!abilityRecord->IsAbilityState(ACTIVATING)) {
|
||||
HILOG_INFO("Add windowInfo at state: %{public}d.", abilityRecord->GetAbilityState());
|
||||
}
|
||||
if (windowTokenToAbilityMap_[windowToken] != nullptr) {
|
||||
// It shouldn't happen. Possible reasons for this case:
|
||||
// 1. windowmanager generates same window token.
|
||||
// 2. abilityms doesn't destroy ability in terminate process.
|
||||
HILOG_ERROR("Window token has been added to other AbilityRecord. ability name: %{private}s",
|
||||
abilityRecord->GetAbilityInfo().name.c_str());
|
||||
} else {
|
||||
abilityRecord->AddWindowInfo(windowToken);
|
||||
windowTokenToAbilityMap_[windowToken] = abilityRecord;
|
||||
HILOG_INFO("Add windowInfo complete, ability:%{public}s", abilityRecord->GetAbilityInfo().name.c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void AbilityStackManager::OnAbilityRequestDone(const sptr<IRemoteObject> &token, const int32_t state)
|
||||
{
|
||||
HILOG_DEBUG("Ability request app state %{public}d done.", state);
|
||||
@ -1241,33 +1211,6 @@ void AbilityStackManager::DumpTopAbility(std::vector<std::string> &info)
|
||||
return;
|
||||
}
|
||||
|
||||
void AbilityStackManager::DumpWaittingAbilityQueue(std::string &result)
|
||||
{
|
||||
std::queue<AbilityRequest> copyQueue;
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> guard(stackLock_);
|
||||
if (waittingAbilityQueue_.empty()) {
|
||||
result = "The waitting ability queue is empty.";
|
||||
return;
|
||||
}
|
||||
copyQueue = waittingAbilityQueue_;
|
||||
}
|
||||
|
||||
result = "User ID #" + std::to_string(userId_) + LINE_SEPARATOR;
|
||||
while (!copyQueue.empty()) {
|
||||
auto ability = copyQueue.front();
|
||||
std::vector<std::string> state;
|
||||
ability.Dump(state);
|
||||
|
||||
for (auto it : state) {
|
||||
result += it;
|
||||
result += LINE_SEPARATOR;
|
||||
}
|
||||
copyQueue.pop();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void AbilityStackManager::EnqueueWaittingAbility(const AbilityRequest &abilityRequest)
|
||||
{
|
||||
waittingAbilityQueue_.push(abilityRequest);
|
||||
@ -1459,34 +1402,6 @@ bool AbilityStackManager::IsLauncherMission(int id)
|
||||
return true;
|
||||
}
|
||||
|
||||
void AbilityStackManager::RestartAbility(const std::shared_ptr<AbilityRecord> abilityRecord)
|
||||
{
|
||||
HILOG_INFO("%{public}s called", __FUNCTION__);
|
||||
CHECK_POINTER(abilityRecord);
|
||||
abilityRecord->SetRestarting(true);
|
||||
if (abilityRecord->IsAbilityState(AbilityState::ACTIVE) ||
|
||||
abilityRecord->IsAbilityState(AbilityState::ACTIVATING) ||
|
||||
abilityRecord->IsAbilityState(AbilityState::FOREGROUND_NEW) ||
|
||||
abilityRecord->IsAbilityState(AbilityState::FOREGROUNDING_NEW)) {
|
||||
abilityRecord->Inactivate();
|
||||
} else if (abilityRecord->IsAbilityState(AbilityState::INACTIVE) ||
|
||||
abilityRecord->IsAbilityState(AbilityState::INACTIVATING)) {
|
||||
MoveToBackgroundTask(abilityRecord);
|
||||
} else if (abilityRecord->IsAbilityState(AbilityState::BACKGROUND) ||
|
||||
abilityRecord->IsAbilityState(AbilityState::MOVING_BACKGROUND) ||
|
||||
abilityRecord->IsAbilityState(AbilityState::BACKGROUND_NEW) ||
|
||||
abilityRecord->IsAbilityState(AbilityState::BACKGROUNDING_NEW)) {
|
||||
auto self(shared_from_this());
|
||||
auto timeoutTask = [abilityRecord, self]() {
|
||||
HILOG_WARN("disconnect ability terminate timeout.");
|
||||
self->CompleteTerminate(abilityRecord);
|
||||
};
|
||||
abilityRecord->Terminate(timeoutTask);
|
||||
} else {
|
||||
HILOG_WARN("target ability can't be restarted.");
|
||||
}
|
||||
}
|
||||
|
||||
void AbilityStackManager::OnAbilityDied(std::shared_ptr<AbilityRecord> abilityRecord)
|
||||
{
|
||||
}
|
||||
@ -1605,11 +1520,6 @@ void AbilityStackManager::HandleActiveTimeout(const std::shared_ptr<AbilityRecor
|
||||
BackToLauncher();
|
||||
}
|
||||
|
||||
int AbilityStackManager::MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AbilityStackManager::ContinueLifecycle()
|
||||
{
|
||||
}
|
||||
@ -1853,60 +1763,6 @@ std::shared_ptr<AbilityRecord> AbilityStackManager::GetTopAbilityOfFullScreen()
|
||||
return topFullStack->GetTopAbilityRecord();
|
||||
}
|
||||
|
||||
int AbilityStackManager::MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AbilityStackManager::ChangeFocusAbility(
|
||||
const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
HILOG_INFO("Change focus ability.");
|
||||
std::lock_guard<std::recursive_mutex> guard(stackLock_);
|
||||
CHECK_POINTER_AND_RETURN(lostFocusToken, ERR_INVALID_VALUE);
|
||||
CHECK_POINTER_AND_RETURN(getFocusToken, ERR_INVALID_VALUE);
|
||||
if (getFocusToken == lostFocusToken) {
|
||||
HILOG_WARN("get token is equal to lost token.");
|
||||
return CHANGE_FOCUS_ABILITY_FAILED;
|
||||
}
|
||||
|
||||
auto currentAbility = GetCurrentTopAbility();
|
||||
CHECK_POINTER_AND_RETURN(currentAbility, CHANGE_FOCUS_ABILITY_FAILED);
|
||||
if (!currentAbility->IsAbilityState(AbilityState::ACTIVE) || !waittingAbilityQueue_.empty()) {
|
||||
HILOG_WARN("Top ability is not active or waiting queue is not empty, change focus failed");
|
||||
return CHANGE_FOCUS_ABILITY_FAILED;
|
||||
}
|
||||
|
||||
auto targetAbility = Token::GetAbilityRecordByToken(getFocusToken);
|
||||
CHECK_POINTER_AND_RETURN(targetAbility, CHANGE_FOCUS_ABILITY_FAILED);
|
||||
return ChangeFocusAbilityLocked(targetAbility);
|
||||
}
|
||||
|
||||
int AbilityStackManager::ChangeFocusAbilityLocked(const std::shared_ptr<AbilityRecord> &targetAbility)
|
||||
{
|
||||
HILOG_INFO("Change focus ability locked.");
|
||||
CHECK_POINTER_AND_RETURN(targetAbility, ERR_INVALID_VALUE);
|
||||
|
||||
auto currentAbility = GetCurrentTopAbility();
|
||||
CHECK_POINTER_AND_RETURN(currentAbility, CHANGE_FOCUS_ABILITY_FAILED);
|
||||
|
||||
if (targetAbility == currentAbility || !targetAbility->IsAbilityState(ACTIVE)) {
|
||||
HILOG_ERROR("Target ability is current ability, or target ability is not active, can't change focus.");
|
||||
return CHANGE_FOCUS_ABILITY_FAILED;
|
||||
}
|
||||
|
||||
auto targetMission = targetAbility->GetMissionRecord();
|
||||
CHECK_POINTER_AND_RETURN_LOG(
|
||||
targetMission, CHANGE_FOCUS_ABILITY_FAILED, " TargetMission is nullptr, change focus failed.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AbilityStackManager::CloseMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AbilityStackManager::JudgingIsRemoveMultiScreenStack(std::shared_ptr<MissionStack> &stack)
|
||||
{
|
||||
HILOG_INFO("Judging is remove multi screen stack.");
|
||||
@ -1991,44 +1847,6 @@ void AbilityStackManager::CheckMissionRecordIsResume(const std::shared_ptr<Missi
|
||||
{
|
||||
}
|
||||
|
||||
int AbilityStackManager::GetMissionSnapshot(int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
HILOG_INFO("Get mission snapshot.");
|
||||
|
||||
std::lock_guard<std::recursive_mutex> guard(stackLock_);
|
||||
|
||||
auto missionRecord = GetMissionRecordFromAllStacks(missionId);
|
||||
CHECK_POINTER_AND_RETURN_LOG(missionRecord, REMOVE_MISSION_ID_NOT_EXIST, "mission is invalid.");
|
||||
auto topAbilityRecord = missionRecord->GetTopAbilityRecord();
|
||||
CHECK_POINTER_AND_RETURN_LOG(topAbilityRecord, REMOVE_MISSION_ID_NOT_EXIST, "top ability is invalid.");
|
||||
auto windowInfo = topAbilityRecord->GetWindowInfo();
|
||||
int windowID = 0;
|
||||
if (windowInfo) {
|
||||
windowID = windowInfo->windowToken_;
|
||||
HILOG_INFO("windowID is %{public}d", windowID);
|
||||
}
|
||||
screenshotHandler_->StartScreenshot(missionId, windowID);
|
||||
auto topAbility = missionRecord->GetTopAbilityRecord();
|
||||
if (topAbility) {
|
||||
OHOS::AppExecFwk::ElementName topElement(topAbility->GetAbilityInfo().deviceId,
|
||||
topAbility->GetAbilityInfo().bundleName,
|
||||
topAbility->GetAbilityInfo().name);
|
||||
missionPixelMap.topAbility = topElement;
|
||||
}
|
||||
|
||||
auto imageInfo = screenshotHandler_->GetImageInfo(missionId);
|
||||
screenshotHandler_->RemoveImageInfo(missionId);
|
||||
HILOG_INFO("width : %{public}d, height: %{public}d", imageInfo.width, imageInfo.height);
|
||||
missionPixelMap.imageInfo.width = imageInfo.width;
|
||||
missionPixelMap.imageInfo.height = imageInfo.height;
|
||||
missionPixelMap.imageInfo.format = imageInfo.format;
|
||||
missionPixelMap.imageInfo.size = imageInfo.size;
|
||||
missionPixelMap.imageInfo.shmKey = SharedMemory::PushSharedMemory(imageInfo.data, imageInfo.size);
|
||||
#endif
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
bool AbilityStackManager::IsLockScreenState()
|
||||
{
|
||||
HILOG_INFO("Is Lock Screen State.");
|
||||
@ -2110,15 +1928,7 @@ bool AbilityStackManager::SubscribeEvent()
|
||||
}
|
||||
EventFwk::CommonEventSubscribeInfo subscribeInfo(matchingSkills);
|
||||
auto handler = DelayedSingleton<AbilityManagerService>::GetInstance()->GetEventHandler();
|
||||
subscriber_ = std::make_shared<LockScreenEventSubscriber>(subscribeInfo, handler);
|
||||
return EventFwk::CommonEventManager::SubscribeCommonEvent(subscriber_);
|
||||
}
|
||||
|
||||
void AbilityStackManager::UpdateLockScreenState(bool isLockScreen)
|
||||
{
|
||||
HILOG_DEBUG("%{public}s begin", __func__);
|
||||
std::lock_guard<std::recursive_mutex> guard(stackLock_);
|
||||
isLockScreen_ = isLockScreen;
|
||||
return true;
|
||||
}
|
||||
|
||||
void AbilityStackManager::ProcessInactivateInMoving(const std::shared_ptr<AbilityRecord> &abilityRecord)
|
||||
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "lock_screen_event_subscriber.h"
|
||||
|
||||
#include "ability_config.h"
|
||||
#include "ability_manager_service.h"
|
||||
#include "hilog_wrapper.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace AAFwk {
|
||||
void LockScreenEventSubscriber::OnReceiveEvent(const EventFwk::CommonEventData &data)
|
||||
{
|
||||
HILOG_INFO("OnReceiveEvent: event=%{public}s", data.GetWant().GetAction().c_str());
|
||||
HILOG_INFO("OnReceiveEvent: data=%{public}s", data.GetData().c_str());
|
||||
HILOG_INFO("OnReceiveEvent: code=%{public}d", data.GetCode());
|
||||
std::string eventName = data.GetWant().GetAction();
|
||||
if (eventName == AbilityConfig::LOCK_SCREEN_EVENT_NAME) {
|
||||
bool isLockScreen = static_cast<bool>(data.GetCode());
|
||||
auto task = [isLockScreen]() {
|
||||
auto service = DelayedSingleton<AbilityManagerService>::GetInstance();
|
||||
service->UpdateLockScreenState(isLockScreen);
|
||||
};
|
||||
handler_->PostTask(task);
|
||||
}
|
||||
}
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
@ -112,7 +112,6 @@ ohos_source_set("abilityms_test_source") {
|
||||
"${services_path}/abilitymgr/src/ability_stack_manager.cpp",
|
||||
"${services_path}/abilitymgr/src/image_info.cpp",
|
||||
"${services_path}/abilitymgr/src/inner_mission_info.cpp",
|
||||
"${services_path}/abilitymgr/src/lock_screen_event_subscriber.cpp",
|
||||
"${services_path}/abilitymgr/src/mission.cpp",
|
||||
"${services_path}/abilitymgr/src/mission_data_storage.cpp",
|
||||
"${services_path}/abilitymgr/src/mission_info.cpp",
|
||||
|
@ -83,8 +83,6 @@ void AppMgrEventHandler::ProcessLoadAbility(const AppExecFwk::InnerEvent::Pointe
|
||||
sptr<IAbilityScheduler> abilitySched = new AbilityScheduler();
|
||||
tokenMap_[abilitySched] = token;
|
||||
server_->AttachAbilityThread(abilitySched, token);
|
||||
static int32_t windowToken = 0;
|
||||
server_->AddWindowInfo(token, ++windowToken);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,9 +111,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{}
|
||||
|
||||
virtual int AttachAbilityThread(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token)
|
||||
{
|
||||
return 0;
|
||||
@ -156,11 +153,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int KillProcess(const std::string &bundleName)
|
||||
{
|
||||
return 0;
|
||||
@ -182,26 +174,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ChangeFocusAbility(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CloseMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
|
@ -395,25 +395,6 @@ HWTEST_F(AbilityManagerProxyTest, AbilityManagerProxy_0015, TestSize.Level1)
|
||||
EXPECT_EQ(res, ERR_INVALID_VALUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityManagerService
|
||||
* Function: AddWindowInfo
|
||||
* SubFunction: NA
|
||||
* FunctionPoints: AbilityManagerService AddWindowInfo
|
||||
* EnvConditions: NA
|
||||
* CaseDescription: Verify the normal conditions of addWindowInfo
|
||||
*/
|
||||
HWTEST_F(AbilityManagerProxyTest, AbilityManagerProxy_0016, TestSize.Level1)
|
||||
{
|
||||
EXPECT_CALL(*mock_, SendRequest(_, _, _, _))
|
||||
.Times(1)
|
||||
.WillOnce(Invoke(mock_.GetRefPtr(), &AbilityManagerStubMock::InvokeSendRequest));
|
||||
sptr<IRemoteObject> token = sptr<IRemoteObject>(new (std::nothrow) MockAbilityToken());
|
||||
proxy_->AddWindowInfo(token, 1);
|
||||
|
||||
EXPECT_EQ(IAbilityManager::ADD_WINDOW_INFO, mock_->code_);
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityManagerService
|
||||
* Function: DumpState
|
||||
|
@ -111,9 +111,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{}
|
||||
|
||||
virtual int AttachAbilityThread(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token)
|
||||
{
|
||||
return 0;
|
||||
@ -156,11 +153,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int KillProcess(const std::string &bundleName)
|
||||
{
|
||||
return 0;
|
||||
@ -182,26 +174,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ChangeFocusAbility(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CloseMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int ClearUpApplicationData(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
|
@ -593,21 +593,6 @@ HWTEST_F(AbilityManagerServiceTest, Interface_012, TestSize.Level1)
|
||||
EXPECT_EQ(res1, OHOS::ERR_INVALID_VALUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityManagerService
|
||||
* Function: DumpWaittingAbilityQueue
|
||||
* SubFunction: NA
|
||||
* FunctionPoints: AbilityManagerService DumpWaittingAbilityQueue
|
||||
* EnvConditions: NA
|
||||
* CaseDescription: Verify dumpwaittingabilityqueue result
|
||||
*/
|
||||
HWTEST_F(AbilityManagerServiceTest, Interface_014, TestSize.Level1)
|
||||
{
|
||||
std::string dump;
|
||||
abilityMs_->DumpWaittingAbilityQueue(dump);
|
||||
EXPECT_EQ(false, (dump.find("User ID #0") != string::npos));
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityManagerService
|
||||
* Function: OnAbilityRequestDone
|
||||
|
@ -139,9 +139,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{}
|
||||
|
||||
virtual int AttachAbilityThread(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token)
|
||||
{
|
||||
return 0;
|
||||
@ -184,11 +181,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int GetMissionSnapshot(const int32_t missionId, MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int KillProcess(const std::string &bundleName)
|
||||
{
|
||||
return 0;
|
||||
@ -199,26 +191,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ChangeFocusAbility(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int CloseMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int UpdateConfiguration(const AppExecFwk::Configuration &config)
|
||||
{
|
||||
return 0;
|
||||
|
@ -49,7 +49,6 @@ public:
|
||||
MOCK_METHOD1(DisconnectAbility, int(const sptr<IAbilityConnection> &));
|
||||
MOCK_METHOD3(AcquireDataAbility, sptr<IAbilityScheduler>(const Uri &, bool, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(ReleaseDataAbility, int(sptr<IAbilityScheduler>, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(AddWindowInfo, void(const sptr<IRemoteObject> &, int32_t));
|
||||
MOCK_METHOD2(AttachAbilityThread, int(const sptr<IAbilityScheduler> &, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD3(AbilityTransitionDone, int(const sptr<IRemoteObject> &, int, const PacMap &));
|
||||
MOCK_METHOD2(ScheduleConnectAbilityDone, int(const sptr<IRemoteObject> &, const sptr<IRemoteObject> &));
|
||||
@ -58,7 +57,6 @@ public:
|
||||
MOCK_METHOD2(DumpState, void(const std::string &, std::vector<std::string> &));
|
||||
MOCK_METHOD2(TerminateAbilityResult, int(const sptr<IRemoteObject> &, int));
|
||||
MOCK_METHOD1(StopServiceAbility, int(const Want &));
|
||||
MOCK_METHOD2(GetMissionSnapshot, int(const int32_t, MissionSnapshotInfo &));
|
||||
MOCK_METHOD1(KillProcess, int(const std::string &));
|
||||
MOCK_METHOD2(UninstallApp, int(const std::string &, int32_t));
|
||||
MOCK_METHOD1(GetMissionIdByToken, int32_t(const sptr<IRemoteObject> &token));
|
||||
@ -80,11 +78,6 @@ public:
|
||||
|
||||
MOCK_METHOD4(StartAbility, int(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
ChangeFocusAbility, int(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken));
|
||||
MOCK_METHOD1(MinimizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(CloseMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(MaximizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(ChangeFocusTest, void(const std::vector<int> missionId));
|
||||
MOCK_METHOD1(TerminateAbilityTest, void(int id));
|
||||
MOCK_METHOD2(GetWantSenderInfo, int(const sptr<IWantSender> &target, std::shared_ptr<WantSenderInfo> &info));
|
||||
|
@ -448,25 +448,6 @@ HWTEST_F(AbilityRecordTest, AaFwk_AbilityMS_Terminate, TestSize.Level1)
|
||||
EXPECT_EQ(abilityRecord_->currentState_, OHOS::AAFwk::AbilityState::TERMINATING);
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityRecord
|
||||
* Function: GetWindowInfo
|
||||
* SubFunction: GetWindowInfo RemoveWindowInfo AddWindowInfo
|
||||
* FunctionPoints: NA
|
||||
* EnvConditions: NA
|
||||
* CaseDescription: Verify windowInfo set get remove success
|
||||
*/
|
||||
HWTEST_F(AbilityRecordTest, AaFwk_AbilityMS_GetWindowInfo, TestSize.Level1)
|
||||
{
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
int windowToken = 1;
|
||||
abilityRecord_->AddWindowInfo(windowToken);
|
||||
EXPECT_NE(abilityRecord_->GetWindowInfo(), nullptr);
|
||||
abilityRecord_->RemoveWindowInfo();
|
||||
EXPECT_EQ(abilityRecord_->GetWindowInfo(), nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityRecord
|
||||
* Function: SetScheduler
|
||||
|
@ -229,10 +229,7 @@ bool LifecycleTest::StartNextAbility()
|
||||
int LifecycleTest::AttachAbility(
|
||||
const OHOS::sptr<OHOS::AAFwk::AbilityScheduler> &scheduler, const OHOS::sptr<OHOS::IRemoteObject> &token)
|
||||
{
|
||||
int ret = abilityMs_->AttachAbilityThread(scheduler, token);
|
||||
static int32_t windowToken = 0;
|
||||
abilityMs_->AddWindowInfo(token, ++windowToken);
|
||||
return ret;
|
||||
return abilityMs_->AttachAbilityThread(scheduler, token);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -77,10 +77,7 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
virtual int AttachAbilityThread(const sptr<AAFwk::IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token)
|
||||
{
|
||||
return 0;
|
||||
@ -162,11 +159,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int GetMissionSnapshot(const int32_t missionId, AAFwk::MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int32_t GetMissionIdByToken(const sptr<IRemoteObject> &token) override
|
||||
{
|
||||
return 0;
|
||||
@ -386,10 +378,6 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken)
|
||||
{
|
||||
return;
|
||||
}
|
||||
virtual int AttachAbilityThread(const sptr<AAFwk::IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token)
|
||||
{
|
||||
return 0;
|
||||
@ -477,10 +465,6 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual int GetMissionSnapshot(const int32_t missionId, AAFwk::MissionPixelMap &missionPixelMap)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int32_t GetMissionIdByToken(const sptr<IRemoteObject> &token) override
|
||||
{
|
||||
@ -504,19 +488,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MinimizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int MaximizeMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int CloseMultiWindow(int missionId)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StartAbility(
|
||||
const Want &want,
|
||||
const AbilityStartSetting &abilityStartSetting,
|
||||
@ -526,10 +497,6 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int ChangeFocusAbility(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void GetSystemMemoryAttr(AppExecFwk::SystemMemoryAttr &memoryInfo)
|
||||
{}
|
||||
|
@ -83,10 +83,6 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual void AddWindowInfo(const sptr<IRemoteObject> &token, int32_t windowToken) override
|
||||
{
|
||||
return;
|
||||
}
|
||||
virtual int AttachAbilityThread(
|
||||
const sptr<AAFwk::IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token) override
|
||||
{
|
||||
@ -122,11 +118,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int GetMissionSnapshot(const int32_t missionId, AAFwk::MissionPixelMap &missionPixelMap) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual int KillProcess(const std::string &bundleName) override
|
||||
{
|
||||
return 0;
|
||||
@ -197,28 +188,11 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int MinimizeMultiWindow(int missionId) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int MaximizeMultiWindow(int missionId) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int CloseMultiWindow(int missionId) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StartAbility(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int requestCode) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int ChangeFocusAbility(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void GetSystemMemoryAttr(AppExecFwk::SystemMemoryAttr &memoryInfo) override
|
||||
{}
|
||||
|
@ -39,7 +39,6 @@ public:
|
||||
MOCK_METHOD1(DisconnectAbility, int(const sptr<IAbilityConnection> &connect));
|
||||
MOCK_METHOD3(AcquireDataAbility, sptr<IAbilityScheduler>(const Uri &, bool, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(ReleaseDataAbility, int(sptr<IAbilityScheduler>, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(AddWindowInfo, void(const sptr<IRemoteObject> &token, int32_t windowToken));
|
||||
MOCK_METHOD2(AttachAbilityThread, int(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token));
|
||||
MOCK_METHOD2(AbilityTransitionDone, int(const sptr<IRemoteObject> &token, int state));
|
||||
MOCK_METHOD2(
|
||||
@ -49,7 +48,6 @@ public:
|
||||
MOCK_METHOD2(DumpState, void(const std::string &args, std::vector<std::string> &state));
|
||||
MOCK_METHOD2(TerminateAbilityResult, int(const sptr<IRemoteObject> &, int startId));
|
||||
MOCK_METHOD1(StopServiceAbility, int(const Want &));
|
||||
MOCK_METHOD2(GetMissionSnapshot, int(const int32_t, MissionPixelMap &));
|
||||
MOCK_METHOD1(GetMissionIdByToken, int32_t(const sptr<IRemoteObject> &token));
|
||||
MOCK_METHOD1(KillProcess, int(const std::string &));
|
||||
MOCK_METHOD2(UninstallApp, int(const std::string &, int32_t));
|
||||
|
@ -44,7 +44,6 @@ public:
|
||||
MOCK_METHOD1(DisconnectAbility, int(const sptr<IAbilityConnection> &connect));
|
||||
MOCK_METHOD3(AcquireDataAbility, sptr<IAbilityScheduler>(const Uri &, bool, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(ReleaseDataAbility, int(sptr<IAbilityScheduler>, const sptr<IRemoteObject> &));
|
||||
MOCK_METHOD2(AddWindowInfo, void(const sptr<IRemoteObject> &token, int32_t windowToken));
|
||||
MOCK_METHOD2(AttachAbilityThread, int(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token));
|
||||
MOCK_METHOD3(AbilityTransitionDone, int(const sptr<IRemoteObject> &token, int state, const PacMap &));
|
||||
MOCK_METHOD2(
|
||||
@ -57,7 +56,6 @@ public:
|
||||
void(const std::string &args, std::vector<std::string>& info, bool isClient, bool isUserID, int UserID));
|
||||
MOCK_METHOD2(TerminateAbilityResult, int(const sptr<IRemoteObject> &, int startId));
|
||||
MOCK_METHOD2(StopServiceAbility, int(const Want &, int32_t userId));
|
||||
MOCK_METHOD2(GetMissionSnapshot, int(const int32_t, MissionPixelMap &));
|
||||
MOCK_METHOD1(GetMissionIdByToken, int32_t(const sptr<IRemoteObject> &token));
|
||||
MOCK_METHOD1(KillProcess, int(const std::string &));
|
||||
MOCK_METHOD2(UninstallApp, int(const std::string &, int32_t));
|
||||
@ -77,11 +75,6 @@ public:
|
||||
MOCK_METHOD2(GetPendingRequestWant, int(const sptr<IWantSender> &target, std::shared_ptr<Want> &want));
|
||||
MOCK_METHOD5(StartAbility, int(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int32_t userId, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
ChangeFocusAbility, int(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken));
|
||||
MOCK_METHOD1(MinimizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(MaximizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(CloseMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(GetSystemMemoryAttr, void(AppExecFwk::SystemMemoryAttr &memoryInfo));
|
||||
MOCK_METHOD3(StartContinuation, int(const Want &want, const sptr<IRemoteObject> &abilityToken, int32_t status));
|
||||
MOCK_METHOD2(NotifyContinuationResult, int(int32_t missionId, int32_t result));
|
||||
|
@ -490,31 +490,6 @@ HWTEST_F(AbilityRecordModuleTest, ConnectionRecord_001, TestSize.Level2)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityRecord
|
||||
* Function: ConnectionRecord
|
||||
* SubFunction: AddWindowInfo/RemoveWindowInfo/GetWindowInfo
|
||||
* FunctionPoints: Ability window info getter and setter
|
||||
* CaseDescription: Check ability window info getter and setter.
|
||||
*/
|
||||
HWTEST_F(AbilityRecordModuleTest, WindowInfo_001, TestSize.Level1)
|
||||
{
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
auto &abilityRequest = MakeDefaultAbilityRequest();
|
||||
|
||||
auto abilityRecord = AbilityRecord::CreateAbilityRecord(abilityRequest);
|
||||
EXPECT_TRUE(abilityRecord);
|
||||
EXPECT_FALSE(abilityRecord->GetWindowInfo());
|
||||
|
||||
for (int i = 0; i < COUNT; ++i) {
|
||||
abilityRecord->AddWindowInfo(123);
|
||||
EXPECT_TRUE(abilityRecord->GetWindowInfo());
|
||||
abilityRecord->RemoveWindowInfo();
|
||||
EXPECT_FALSE(abilityRecord->GetWindowInfo());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AbilityRecord
|
||||
* Function: Terminating
|
||||
|
@ -519,47 +519,5 @@ HWTEST_F(DumpModuleTest, dump_module_test_09, TestSize.Level2)
|
||||
g_abilityMs->DumpState(args, dumpInfo);
|
||||
EXPECT_EQ(2UL, dumpInfo.size());
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: Aafwk
|
||||
* Function: DumpWaittingAbilityQueue
|
||||
* SubFunction: NA
|
||||
* FunctionPoints: test AbilityStackManager DumpWaittingAbilityQueue
|
||||
* EnvConditions: System running normally
|
||||
* CaseDescription: Dump info of abilities in waiting queue
|
||||
*/
|
||||
HWTEST_F(DumpModuleTest, dump_module_test_011, TestSize.Level2)
|
||||
{
|
||||
Want want1;
|
||||
Want want2;
|
||||
std::string expectResult("The waitting ability queue is empty.");
|
||||
|
||||
std::string args("--waitting-queue");
|
||||
std::vector<std::string> result;
|
||||
std::string waitingQueueResult;
|
||||
|
||||
g_abilityMs->DumpState(args, result);
|
||||
auto stackMgr = g_abilityMs->GetStackManager();
|
||||
EXPECT_TRUE(stackMgr);
|
||||
g_abilityMs->DumpWaittingAbilityQueue(waitingQueueResult);
|
||||
EXPECT_EQ(waitingQueueResult, expectResult);
|
||||
|
||||
result.clear();
|
||||
waitingQueueResult.clear();
|
||||
|
||||
want1.SetElement(G_TESTABILITY1);
|
||||
want2.SetElement(G_TESTABILITY5);
|
||||
|
||||
int ref = g_abilityMs->StartAbility(want1);
|
||||
EXPECT_EQ(ref, 0);
|
||||
int refwant2 = g_abilityMs->StartAbility(want2);
|
||||
EXPECT_EQ(refwant2, START_ABILITY_WAITING);
|
||||
|
||||
g_abilityMs->DumpState(args, result);
|
||||
EXPECT_TRUE(stackMgr);
|
||||
stackMgr->DumpWaittingAbilityQueue(waitingQueueResult);
|
||||
EXPECT_NE(std::string::npos, waitingQueueResult.find("com.ix.hiRadio"));
|
||||
}
|
||||
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
|
@ -189,33 +189,6 @@ HWTEST_F(IpcAbilityMgrModuleTest, AbilityMgrService_IPC_004, TestSize.Level1)
|
||||
GTEST_LOG_(INFO) << "IpcAbilityMgrModuleTest AbilityMgrService_IPC_004 end";
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AAFwk
|
||||
* Function: AbilityManagerService
|
||||
* SubFunction: IPC of client and server
|
||||
* FunctionPoints: AddWindowInfo
|
||||
* EnvConditions: NA
|
||||
* CaseDescription: verify AddWindowInfo IPC between client and server.
|
||||
*/
|
||||
HWTEST_F(IpcAbilityMgrModuleTest, AbilityMgrService_IPC_005, TestSize.Level1)
|
||||
{
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
GTEST_LOG_(INFO) << "IpcAbilityMgrModuleTest AbilityMgrService_IPC_005 start";
|
||||
for (int i = 0; i < COUNT; i++) {
|
||||
sptr<MockAbilityMgrService> mockAbilityMgr(new MockAbilityMgrService());
|
||||
sptr<IAbilityManager> abilityMgrClient = iface_cast<IAbilityManager>(mockAbilityMgr);
|
||||
|
||||
EXPECT_CALL(*mockAbilityMgr, AddWindowInfo(_, _))
|
||||
.Times(1)
|
||||
.WillOnce(InvokeWithoutArgs(mockAbilityMgr.GetRefPtr(), &MockAbilityMgrService::PostVoid));
|
||||
abilityMgrClient->AddWindowInfo(nullptr, 0);
|
||||
mockAbilityMgr->Wait();
|
||||
}
|
||||
|
||||
GTEST_LOG_(INFO) << "IpcAbilityMgrModuleTest AbilityMgrService_IPC_005 end";
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AAFwk
|
||||
* Function: AbilityManagerService
|
||||
@ -412,33 +385,6 @@ HWTEST_F(IpcAbilityMgrModuleTest, AbilityMgrService_IPC_013, TestSize.Level1)
|
||||
GTEST_LOG_(INFO) << "IpcAbilityMgrModuleTest AbilityMgrService_IPC_013 end";
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AAFwk
|
||||
* Function: AbilityManagerService
|
||||
* SubFunction: IPC of client and server
|
||||
* FunctionPoints: GetMissionSnapshot
|
||||
* EnvConditions: NA
|
||||
* CaseDescription: verify GetMissionSnapshot IPC between client and server.
|
||||
*/
|
||||
HWTEST_F(IpcAbilityMgrModuleTest, AbilityMgrService_IPC_015, TestSize.Level1)
|
||||
{
|
||||
GTEST_LOG_(INFO) << "IpcAbilityMgrModuleTest AbilityMgrService_IPC_015 start";
|
||||
|
||||
for (int i = 0; i < COUNT; i++) {
|
||||
sptr<MockAbilityMgrService> mockAbilityMgr(new MockAbilityMgrService());
|
||||
sptr<IAbilityManager> abilityMgrClient = iface_cast<IAbilityManager>(mockAbilityMgr);
|
||||
|
||||
MissionPixelMap missionPixelMap;
|
||||
EXPECT_CALL(*mockAbilityMgr, GetMissionSnapshot(_, _))
|
||||
.Times(1)
|
||||
.WillOnce(InvokeWithoutArgs(mockAbilityMgr.GetRefPtr(), &MockAbilityMgrService::Post));
|
||||
abilityMgrClient->GetMissionSnapshot(1, missionPixelMap);
|
||||
mockAbilityMgr->Wait();
|
||||
}
|
||||
|
||||
GTEST_LOG_(INFO) << "IpcAbilityMgrModuleTest AbilityMgrService_IPC_015 end";
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature: AAFwk
|
||||
* Function: AbilityManagerService
|
||||
|
@ -62,7 +62,6 @@ public:
|
||||
sptr<IAbilityScheduler>(const Uri &uri, bool tryBind, const sptr<IRemoteObject> &callerToken));
|
||||
MOCK_METHOD2(
|
||||
ReleaseDataAbility, int(sptr<IAbilityScheduler> dataAbilityScheduler, const sptr<IRemoteObject> &callerToken));
|
||||
MOCK_METHOD2(AddWindowInfo, void(const sptr<IRemoteObject> &token, int32_t windowToken));
|
||||
MOCK_METHOD2(AttachAbilityThread, int(const sptr<IAbilityScheduler> &scheduler, const sptr<IRemoteObject> &token));
|
||||
MOCK_METHOD3(AbilityTransitionDone, int(const sptr<IRemoteObject> &token, int state, const PacMap &));
|
||||
MOCK_METHOD2(
|
||||
@ -77,7 +76,6 @@ public:
|
||||
int StopServiceAbility(const Want &want, int32_t userId = DEFAULT_INVAL_VALUE);
|
||||
|
||||
MOCK_METHOD2(TerminateAbilityByCaller, int(const sptr<IRemoteObject> &callerToken, int requestCode));
|
||||
MOCK_METHOD2(GetMissionSnapshot, int(const int32_t missionId, MissionPixelMap &missionPixelMap));
|
||||
MOCK_METHOD1(KillProcess, int(const std::string &bundleName));
|
||||
MOCK_METHOD2(UninstallApp, int(const std::string &bundleName, int32_t uid));
|
||||
|
||||
@ -96,12 +94,7 @@ public:
|
||||
MOCK_METHOD1(UpdateConfiguration, int(const AppExecFwk::Configuration &));
|
||||
MOCK_METHOD5(StartAbility, int(const Want &want, const AbilityStartSetting &abilityStartSetting,
|
||||
const sptr<IRemoteObject> &callerToken, int32_t userId, int requestCode));
|
||||
MOCK_METHOD2(
|
||||
ChangeFocusAbility, int(const sptr<IRemoteObject> &lostFocusToken, const sptr<IRemoteObject> &getFocusToken));
|
||||
MOCK_METHOD1(MinimizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(MaximizeMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(GetMissionIdByToken, int32_t(const sptr<IRemoteObject> &token));
|
||||
MOCK_METHOD1(CloseMultiWindow, int(int missionId));
|
||||
MOCK_METHOD1(GetPendinTerminateAbilityTestgRequestWant, void(int id));
|
||||
MOCK_METHOD1(GetSystemMemoryAttr, void(AppExecFwk::SystemMemoryAttr &memoryInfo));
|
||||
MOCK_METHOD3(StartContinuation, int(const Want &want, const sptr<IRemoteObject> &abilityToken, int32_t status));
|
||||
|
Loading…
Reference in New Issue
Block a user