!51 修复代码检查 & 增加断连接口

Merge pull request !51 from Mupceet/master
This commit is contained in:
openharmony_ci 2022-03-09 01:37:00 +00:00 committed by Gitee
commit 80890a11bb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
42 changed files with 870 additions and 457 deletions

View File

@ -12,9 +12,6 @@
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.
Notes:
This is project config file for OpenHarmony OSS Audit Tool, if you have any questions or concerns, please email chenyaxun@huawei.com.
-->
<!-- OAT(OSS Audit Tool) configuration guide:
basedir: Root dir, the basedir + project path is the real source file location.

View File

@ -134,6 +134,7 @@ void AccessibleAbilityClientStubImpl::Disconnect(const int channelId)
}
} else {
AccessibilityUITestAbility::GetInstance()->SetChannelId(channelId_);
uiTestListener_->OnAbilityDisconnected();
uiTestListener_ = nullptr;
}
}

View File

@ -23,29 +23,38 @@ namespace OHOS {
namespace Accessibility {
bool AccessibilityElementInfo::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool AccessibilityElementInfo::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
sptr<AccessibilityElementInfo> AccessibilityElementInfo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
return nullptr;
}
void AccessibilityElementInfo::SetComponentId(const int componentId)
{}
{
(void)componentId;
}
bool AccessibilityElementInfo::GetFocus(const int focus, AccessibilityElementInfo &elementInfo)
{
(void)focus;
(void)elementInfo;
return true;
}
bool AccessibilityElementInfo::GetNext(const FocusMoveDirection direction, AccessibilityElementInfo &elementInfo)
{
(void)direction;
(void)elementInfo;
return true;
}
@ -60,6 +69,8 @@ int AccessibilityElementInfo::GetChildCount() const
bool AccessibilityElementInfo::GetChild(const int index, AccessibilityElementInfo &elementInfo)
{
(void)index;
(void)elementInfo;
return true;
}
@ -69,10 +80,13 @@ std::vector<int> AccessibilityElementInfo::GetChildIds() const
}
void AccessibilityElementInfo::AddChild(const int childId)
{}
{
(void)childId;
}
bool AccessibilityElementInfo::RemoveChild(const int childId)
{
(void)childId;
return true;
}
@ -82,13 +96,18 @@ std::vector<AccessibleAction> AccessibilityElementInfo::GetActionList() const
}
void AccessibilityElementInfo::AddAction(AccessibleAction &operation)
{}
{
(void)operation;
}
void AccessibilityElementInfo::DeleteAction(AccessibleAction &operation)
{}
{
(void)operation;
}
bool AccessibilityElementInfo::DeleteAction(ActionType &operationType)
{
(void)operationType;
return true;
}
@ -96,7 +115,9 @@ void AccessibilityElementInfo::DeleteAllActions()
{}
void AccessibilityElementInfo::SetTextLengthLimit(const int max)
{}
{
(void)max;
}
int AccessibilityElementInfo::GetTextLengthLimit() const
{
@ -106,18 +127,25 @@ int AccessibilityElementInfo::GetTextLengthLimit() const
bool AccessibilityElementInfo::ExecuteAction(const ActionType &operation,
const std::map<std::string, std::string> &actionArguments)
{
(void)operation;
(void)actionArguments;
return true;
}
bool AccessibilityElementInfo::GetByContent(const std::string &text,
std::vector<AccessibilityElementInfo> &elementInfos)
{
(void)text;
(void)elementInfos;
return true;
}
bool AccessibilityElementInfo::GetElementInfosById(const int elementId, int mode,
std::vector<AccessibilityElementInfo> &elementInfos)
{
(void)elementId;
(void)mode;
(void)elementInfos;
return true;
}
@ -127,10 +155,13 @@ int AccessibilityElementInfo::GetWindowId() const
}
void AccessibilityElementInfo::SetWindowId(const int windowId)
{}
{
(void)windowId;
}
bool AccessibilityElementInfo::GetParent(AccessibilityElementInfo &elementInfo)
{
(void)elementInfo;
return true;
}
@ -140,7 +171,9 @@ int AccessibilityElementInfo::GetParentNodeId() const
}
void AccessibilityElementInfo::SetParent(const int parentId)
{}
{
(void)parentId;
}
Rect AccessibilityElementInfo::GetRectInScreen() const
{
@ -148,7 +181,9 @@ Rect AccessibilityElementInfo::GetRectInScreen() const
}
void AccessibilityElementInfo::SetRectInScreen(Rect &bounds)
{}
{
(void)bounds;
}
bool AccessibilityElementInfo::IsCheckable() const
{
@ -156,7 +191,9 @@ bool AccessibilityElementInfo::IsCheckable() const
}
void AccessibilityElementInfo::SetCheckable(const bool checkable)
{}
{
(void)checkable;
}
bool AccessibilityElementInfo::IsChecked() const
{
@ -164,7 +201,9 @@ bool AccessibilityElementInfo::IsChecked() const
}
void AccessibilityElementInfo::SetChecked(const bool checked)
{}
{
(void)checked;
}
bool AccessibilityElementInfo::IsFocusable() const
{
@ -172,7 +211,9 @@ bool AccessibilityElementInfo::IsFocusable() const
}
void AccessibilityElementInfo::SetFocusable(const bool focusable)
{}
{
(void)focusable;
}
bool AccessibilityElementInfo::IsFocused() const
{
@ -180,7 +221,9 @@ bool AccessibilityElementInfo::IsFocused() const
}
void AccessibilityElementInfo::SetFocused(const bool focused)
{}
{
(void)focused;
}
bool AccessibilityElementInfo::IsVisible() const
{
@ -188,7 +231,9 @@ bool AccessibilityElementInfo::IsVisible() const
}
void AccessibilityElementInfo::SetVisible(const bool visible)
{}
{
(void)visible;
}
bool AccessibilityElementInfo::HasAccessibilityFocus() const
{
@ -196,7 +241,9 @@ bool AccessibilityElementInfo::HasAccessibilityFocus() const
}
void AccessibilityElementInfo::SetAccessibilityFocus(const bool focused)
{}
{
(void)focused;
}
bool AccessibilityElementInfo::IsSelected() const
{
@ -204,7 +251,9 @@ bool AccessibilityElementInfo::IsSelected() const
}
void AccessibilityElementInfo::SetSelected(const bool selected)
{}
{
(void)selected;
}
bool AccessibilityElementInfo::IsClickable() const
{
@ -212,7 +261,9 @@ bool AccessibilityElementInfo::IsClickable() const
}
void AccessibilityElementInfo::SetClickable(const bool clickable)
{}
{
(void)clickable;
}
bool AccessibilityElementInfo::IsLongClickable() const
{
@ -220,7 +271,9 @@ bool AccessibilityElementInfo::IsLongClickable() const
}
void AccessibilityElementInfo::SetLongClickable(const bool longClickable)
{}
{
(void)longClickable;
}
bool AccessibilityElementInfo::IsEnabled() const
{
@ -228,7 +281,9 @@ bool AccessibilityElementInfo::IsEnabled() const
}
void AccessibilityElementInfo::SetEnabled(const bool enabled)
{}
{
(void)enabled;
}
bool AccessibilityElementInfo::IsPassword() const
{
@ -236,7 +291,9 @@ bool AccessibilityElementInfo::IsPassword() const
}
void AccessibilityElementInfo::SetPassword(const bool password)
{}
{
(void)password;
}
bool AccessibilityElementInfo::IsScrollable() const
{
@ -244,7 +301,9 @@ bool AccessibilityElementInfo::IsScrollable() const
}
void AccessibilityElementInfo::SetScrollable(const bool scrollable)
{}
{
(void)scrollable;
}
int AccessibilityElementInfo::GetCurrentIndex() const
{
@ -252,7 +311,9 @@ int AccessibilityElementInfo::GetCurrentIndex() const
}
void AccessibilityElementInfo::SetCurrentIndex(const int index)
{}
{
(void)index;
}
int AccessibilityElementInfo::GetBeginIndex() const
{
@ -260,7 +321,9 @@ int AccessibilityElementInfo::GetBeginIndex() const
}
void AccessibilityElementInfo::SetBeginIndex(const int index)
{}
{
(void)index;
}
int AccessibilityElementInfo::GetEndIndex() const
{
@ -268,7 +331,9 @@ int AccessibilityElementInfo::GetEndIndex() const
}
void AccessibilityElementInfo::SetEndIndex(const int index)
{}
{
(void)index;
}
int AccessibilityElementInfo::GetInputType() const
{
@ -276,7 +341,9 @@ int AccessibilityElementInfo::GetInputType() const
}
void AccessibilityElementInfo::SetInputType(const int inputType)
{}
{
(void)inputType;
}
bool AccessibilityElementInfo::IsEditable() const
{
@ -284,7 +351,9 @@ bool AccessibilityElementInfo::IsEditable() const
}
void AccessibilityElementInfo::SetEditable(const bool editable)
{}
{
(void)editable;
}
bool AccessibilityElementInfo::IsPluraLineSupported() const
{
@ -292,7 +361,9 @@ bool AccessibilityElementInfo::IsPluraLineSupported() const
}
void AccessibilityElementInfo::SetPluraLineSupported(const bool multiLine)
{}
{
(void)multiLine;
}
bool AccessibilityElementInfo::IsPopupSupported() const
{
@ -300,7 +371,9 @@ bool AccessibilityElementInfo::IsPopupSupported() const
}
void AccessibilityElementInfo::SetPopupSupported(const bool supportPopup)
{}
{
(void)supportPopup;
}
bool AccessibilityElementInfo::IsDeletable() const
{
@ -308,7 +381,9 @@ bool AccessibilityElementInfo::IsDeletable() const
}
void AccessibilityElementInfo::SetDeletable(const bool deletable)
{}
{
(void)deletable;
}
bool AccessibilityElementInfo::IsEssential() const
{
@ -316,7 +391,9 @@ bool AccessibilityElementInfo::IsEssential() const
}
void AccessibilityElementInfo::SetEssential(const bool important)
{}
{
(void)important;
}
bool AccessibilityElementInfo::IsGivingHint() const
{
@ -324,7 +401,9 @@ bool AccessibilityElementInfo::IsGivingHint() const
}
void AccessibilityElementInfo::SetHinting(const bool hinting)
{}
{
(void)hinting;
}
std::string AccessibilityElementInfo::GetBundleName() const
{
@ -344,7 +423,9 @@ std::string AccessibilityElementInfo::GetComponentType() const
}
void AccessibilityElementInfo::SetComponentType(const std::string &className)
{}
{
(void)className;
}
std::string AccessibilityElementInfo::GetContent() const
{
@ -352,7 +433,9 @@ std::string AccessibilityElementInfo::GetContent() const
}
void AccessibilityElementInfo::SetContent(const std::string &text)
{}
{
(void)text;
}
std::string AccessibilityElementInfo::GetAccessibilityContent() const
{
@ -360,10 +443,14 @@ std::string AccessibilityElementInfo::GetAccessibilityContent() const
}
void AccessibilityElementInfo::SetAccessibilityContent(const std::string &text)
{}
{
(void)text;
}
void AccessibilityElementInfo::SetSelectedBegin(const int start)
{}
{
(void)start;
}
int AccessibilityElementInfo::GetSelectedBegin() const
{
@ -371,7 +458,9 @@ int AccessibilityElementInfo::GetSelectedBegin() const
}
void AccessibilityElementInfo::SetSelectedEnd(const int end)
{}
{
(void)end;
}
int AccessibilityElementInfo::GetSelectedEnd() const
{
@ -384,7 +473,9 @@ std::string AccessibilityElementInfo::GetAccessibilityDescription() const
}
void AccessibilityElementInfo::SetAccessibilityDescription(const std::string &text)
{}
{
(void)text;
}
bool AccessibilityElementInfo::GetAccessibilityGroup() const
{
@ -392,7 +483,9 @@ bool AccessibilityElementInfo::GetAccessibilityGroup() const
}
void AccessibilityElementInfo::SetAccessibilityGroup(const bool group)
{}
{
(void)group;
}
std::string AccessibilityElementInfo::GetHint() const
{
@ -400,7 +493,9 @@ std::string AccessibilityElementInfo::GetHint() const
}
void AccessibilityElementInfo::SetHint(const std::string &hintText)
{}
{
(void)hintText;
}
std::string AccessibilityElementInfo::GetDescriptionInfo() const
{
@ -408,10 +503,14 @@ std::string AccessibilityElementInfo::GetDescriptionInfo() const
}
void AccessibilityElementInfo::SetDescriptionInfo(const std::string contentDescription)
{}
{
(void)contentDescription;
}
void AccessibilityElementInfo::SetComponentResourceId(const std::string &viewIdResName)
{}
{
(void)viewIdResName;
}
std::string AccessibilityElementInfo::GetComponentResourceId() const
{
@ -419,7 +518,9 @@ std::string AccessibilityElementInfo::GetComponentResourceId() const
}
void AccessibilityElementInfo::SetLiveRegion(const int liveRegion)
{}
{
(void)liveRegion;
}
int AccessibilityElementInfo::GetLiveRegion() const
{
@ -427,7 +528,9 @@ int AccessibilityElementInfo::GetLiveRegion() const
}
void AccessibilityElementInfo::SetContentInvalid(const bool contentInvalid)
{}
{
(void)contentInvalid;
}
bool AccessibilityElementInfo::GetContentInvalid() const
{
@ -435,7 +538,9 @@ bool AccessibilityElementInfo::GetContentInvalid() const
}
void AccessibilityElementInfo::SetError(const std::string &error)
{}
{
(void)error;
}
std::string AccessibilityElementInfo::GetError() const
{
@ -443,10 +548,13 @@ std::string AccessibilityElementInfo::GetError() const
}
void AccessibilityElementInfo::SetLabeled(const int componentId)
{}
{
(void)componentId;
}
bool AccessibilityElementInfo::GetLabeled(AccessibilityElementInfo &elementInfo) const
{
(void)elementInfo;
return true;
}
@ -461,10 +569,14 @@ int AccessibilityElementInfo::GetChannelId() const
}
void AccessibilityElementInfo::SetChannelId(const int channelId)
{}
{
(void)channelId;
}
void AccessibilityElementInfo::SetAccessibilityId(const int componentId)
{}
{
(void)componentId;
}
int AccessibilityElementInfo::GetAccessibilityId() const
{
@ -477,7 +589,9 @@ RangeInfo AccessibilityElementInfo::GetRange() const
}
void AccessibilityElementInfo::SetRange(RangeInfo &rangeInfo)
{}
{
(void)rangeInfo;
}
GridInfo AccessibilityElementInfo::GetGrid() const
{
@ -485,7 +599,9 @@ GridInfo AccessibilityElementInfo::GetGrid() const
}
void AccessibilityElementInfo::SetGrid(const GridInfo &grid)
{}
{
(void)grid;
}
GridItemInfo AccessibilityElementInfo::GetGridItem() const
{
@ -493,28 +609,36 @@ GridItemInfo AccessibilityElementInfo::GetGridItem() const
}
void AccessibilityElementInfo::SetGridItem(const GridItemInfo &gridItem)
{}
{
(void)gridItem;
}
AccessibilityElementInfo::AccessibilityElementInfo()
{}
bool AccessibleAction::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool AccessibleAction::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
sptr<AccessibleAction> AccessibleAction::Unmarshalling(Parcel& parcel)
{
(void)parcel;
return nullptr;
}
AccessibleAction::AccessibleAction(ActionType operationType, std::string description)
{}
{
(void)operationType;
(void)description;
}
ActionType AccessibleAction::GetActionType() const
{
@ -528,21 +652,28 @@ std::string AccessibleAction::GetDescriptionInfo() const
bool RangeInfo::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool RangeInfo::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
sptr<RangeInfo> RangeInfo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
return nullptr;
}
RangeInfo::RangeInfo(int min, int max, int current)
{}
{
(void)min;
(void)max;
(void)current;
}
int RangeInfo::GetMin() const
{
@ -560,37 +691,56 @@ int RangeInfo::GetCurrent() const
}
void RangeInfo::SetMin(int min)
{}
{
(void)min;
}
void RangeInfo::SetMax(int max)
{}
{
(void)max;
}
void RangeInfo::SetCurrent(int current)
{}
{
(void)current;
}
bool GridInfo::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool GridInfo::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
sptr<GridInfo> GridInfo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
return nullptr;
}
GridInfo::GridInfo(int rowCount, int columnCount, int mode)
{}
{
(void)rowCount;
(void)columnCount;
(void)mode;
}
void GridInfo::SetGrid(int rowCount, int columnCount, int mode)
{}
{
(void)rowCount;
(void)columnCount;
(void)mode;
}
void GridInfo::SetGrid(GridInfo other)
{}
{
(void)other;
}
int GridInfo::GetRowCount() const
{
@ -609,28 +759,47 @@ int GridInfo::GetSelectionMode() const
bool GridItemInfo::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool GridItemInfo::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
sptr<GridItemInfo> GridItemInfo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
return nullptr;
}
GridItemInfo::GridItemInfo(int rowIndex, int rowSpan, int columnIndex, int columnSpan, bool heading, bool selected)
{}
{
(void)rowIndex;
(void)rowSpan;
(void)columnIndex;
(void)columnSpan;
(void)heading;
(void)selected;
}
void GridItemInfo::SetGridItemInfo(GridItemInfo other)
{}
{
(void)other;
}
void GridItemInfo::SetGridItemInfo(int rowIndex, int rowSpan,
int columnIndex, int columnSpan, bool heading, bool selected)
{}
{
(void)rowIndex;
(void)rowSpan;
(void)columnIndex;
(void)columnSpan;
(void)heading;
(void)selected;
}
int GridItemInfo::GetColumnIndex() const
{
@ -664,16 +833,19 @@ bool GridItemInfo::IsSelected() const
bool Rect::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool Rect::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
sptr<Rect> Rect::Unmarshalling(Parcel& parcel)
{
(void)parcel;
sptr<Rect> rect = new Rect();
return rect;
}

View File

@ -29,32 +29,50 @@ AccessibilityElementOperatorCallbackProxy::~AccessibilityElementOperatorCallback
bool AccessibilityElementOperatorCallbackProxy::WriteInterfaceToken(MessageParcel &data)
{
(void)data;
return true;
}
void AccessibilityElementOperatorCallbackProxy::SetSearchElementInfoByAccessibilityIdResult(
const std::vector<AccessibilityElementInfo> &infos, const int requestId)
{}
{
(void)infos;
(void)requestId;
}
void AccessibilityElementOperatorCallbackProxy::SetSearchElementInfoByTextResult(
const std::vector<AccessibilityElementInfo> &infos, const int requestId)
{}
{
(void)infos;
(void)requestId;
}
void AccessibilityElementOperatorCallbackProxy::SetFindFocusedElementInfoResult(
const AccessibilityElementInfo &info, const int requestId)
{}
{
(void)info;
(void)requestId;
}
void AccessibilityElementOperatorCallbackProxy::SetFocusMoveSearchResult(const AccessibilityElementInfo &info,
const int requestId)
{}
{
(void)info;
(void)requestId;
}
void AccessibilityElementOperatorCallbackProxy::SetExecuteActionResult(const bool succeeded, const int requestId)
{}
{
(void)succeeded;
(void)requestId;
}
template<typename T>
bool AccessibilityElementOperatorCallbackProxy::WriteParcelableVector(const std::vector<T> &parcelableVector,
Parcel &reply)
{
(void)parcelableVector;
(void)reply;
return true;
}
} // namespace Accessibility

View File

@ -26,36 +26,50 @@ AccessibilityElementOperatorCallbackStub::~AccessibilityElementOperatorCallbackS
int AccessibilityElementOperatorCallbackStub::OnRemoteRequest(uint32_t code, MessageParcel &data,
MessageParcel &reply, MessageOption &option)
{
(void)code;
(void)data;
(void)reply;
(void)option;
return 0;
}
ErrCode AccessibilityElementOperatorCallbackStub::HandleSetSearchElementInfoByAccessibilityIdResult(
MessageParcel &data, MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorCallbackStub::HandleSetSearchElementInfoByTextResult(
MessageParcel &data, MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorCallbackStub::HandleSetFindFocusedElementInfoResult(MessageParcel &data,
MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorCallbackStub::HandleSetFocusMoveSearchResult(MessageParcel &data,
MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorCallbackStub::HandleSetExecuteActionResult(MessageParcel &data,
MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
} // namespace Accessibility

View File

@ -35,70 +35,114 @@ AccessibilityElementOperatorStub::~AccessibilityElementOperatorStub()
int AccessibilityElementOperatorStub::OnRemoteRequest(uint32_t code, MessageParcel &data,
MessageParcel &reply, MessageOption &option)
{
(void)code;
(void)data;
(void)reply;
(void)option;
return 0;
}
ErrCode AccessibilityElementOperatorStub::HandleSearchElementInfoByAccessibilityId(MessageParcel &data,
MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorStub::HandleSearchElementInfosByText(MessageParcel &data,
MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorStub::HandleFindFocusedElementInfo(MessageParcel &data,
MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorStub::HandleFocusFind(MessageParcel &data, MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorStub::HandleExecuteAction(MessageParcel &data, MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorStub::HandleClearFocus(MessageParcel &data, MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
ErrCode AccessibilityElementOperatorStub::HandleOutsideTouch(MessageParcel &data, MessageParcel &reply)
{
(void)data;
(void)reply;
return NO_ERROR;
}
void AccessibilityElementOperatorStub::SearchElementInfoByAccessibilityId(const long elementId,
const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback, const int mode)
{}
{
(void)elementId;
(void)requestId;
(void)callback;
(void)mode;
}
void AccessibilityElementOperatorStub::SearchElementInfosByText(const long elementId,
const std::string &text,
const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback)
{}
{
(void)elementId;
(void)text;
(void)requestId;
(void)callback;
}
void AccessibilityElementOperatorStub::FindFocusedElementInfo(const long elementId,
const int focusType, const int requestId,
const sptr<IAccessibilityElementOperatorCallback> &callback)
{}
{
(void)elementId;
(void)focusType;
(void)requestId;
(void)callback;
}
void AccessibilityElementOperatorStub::FocusMoveSearch(const long elementId,
const int direction, const int requestId,
const sptr<IAccessibilityElementOperatorCallback> &callback)
{}
{
(void)elementId;
(void)direction;
(void)requestId;
(void)callback;
}
void AccessibilityElementOperatorStub::ExecuteAction(const long elementId,
const int action, const std::map<std::string, std::string> actionArguments,
int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback)
{}
{
(void)elementId;
(void)action;
(void)actionArguments;
(void)requestId;
(void)callback;
}
void AccessibilityElementOperatorStub::ClearFocus()
{}
@ -118,23 +162,38 @@ AccessibilityElementOperatorStub::CallbackImpl::CallbackImpl(const int requestId
void AccessibilityElementOperatorStub::CallbackImpl::SetSearchElementInfoByAccessibilityIdResult(
const std::list<AccessibilityElementInfo> &infos, const int requestId)
{}
{
(void)infos;
(void)requestId;
}
void AccessibilityElementOperatorStub::CallbackImpl::SetSearchElementInfoByTextResult(
const std::list<AccessibilityElementInfo> &infos, const int requestId)
{}
{
(void)infos;
(void)requestId;
}
void AccessibilityElementOperatorStub::CallbackImpl::SetFindFocusedElementInfoResult(
const AccessibilityElementInfo &info, const int requestId)
{}
{
(void)infos;
(void)requestId;
}
void AccessibilityElementOperatorStub::CallbackImpl::SetFocusMoveSearchResult(
const AccessibilityElementInfo &info, const int requestId)
{}
{
(void)infos;
(void)requestId;
}
void AccessibilityElementOperatorStub::CallbackImpl::SetExecuteActionResult(
const bool succeeded, const int requestId)
{}
{
(void)succeeded;
(void)requestId;
}
AccessibilityElementOperatorCallbacks AccessibilityElementOperatorStub::CallbackImpl::GetAACallbackList()
{
@ -142,6 +201,8 @@ AccessibilityElementOperatorCallbacks AccessibilityElementOperatorStub::Callback
}
void AccessibilityElementOperatorStub::CallbackImpl::RemoveAACallbackList(int requestId)
{}
{
(void)requestId;
}
} // namespace Accessibility
} // namespace OHOS

View File

@ -21,22 +21,27 @@ namespace OHOS {
namespace Accessibility {
bool AccessibilityMemo::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool AccessibilityMemo::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
}
AccessibilityMemo* AccessibilityMemo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
AccessibilityMemo* accessibilityRecord = new AccessibilityMemo();
return accessibilityRecord;
}
void AccessibilityMemo::SetChannelId(const int channelId)
{}
{
(void)channelId;
}
int AccessibilityMemo::GetChannelId() const
{
@ -44,10 +49,13 @@ int AccessibilityMemo::GetChannelId() const
}
void AccessibilityMemo::SetSource(const int componentId)
{}
{
(void)componentId;
}
bool AccessibilityMemo::GetSource(AccessibilityElementInfo &elementInfo) const
{
(void)elementInfo;
return true;
}
@ -62,7 +70,9 @@ int AccessibilityMemo::GetAccessibilityId() const
}
void AccessibilityMemo::SetWindowId(const int windowId)
{}
{
(void)windowId;
}
int AccessibilityMemo::GetWindowId() const
{
@ -75,7 +85,9 @@ int AccessibilityMemo::GetCurrentIndex() const
}
void AccessibilityMemo::SetCurrentIndex(const int index)
{}
{
(void)index;
}
int AccessibilityMemo::GetBeginIndex() const
{
@ -83,7 +95,9 @@ int AccessibilityMemo::GetBeginIndex() const
}
void AccessibilityMemo::SetBeginIndex(const int index)
{}
{
(void)index;
}
int AccessibilityMemo::GetEndIndex() const
{
@ -91,7 +105,9 @@ int AccessibilityMemo::GetEndIndex() const
}
void AccessibilityMemo::SetEndIndex(const int index)
{}
{
(void)index;
}
std::string AccessibilityMemo::GetComponentType() const
{
@ -99,7 +115,9 @@ std::string AccessibilityMemo::GetComponentType() const
}
void AccessibilityMemo::SetComponentType(const std::string &className)
{}
{
(void)className;
}
std::string AccessibilityMemo::GetBeforeText() const
{
@ -107,10 +125,14 @@ std::string AccessibilityMemo::GetBeforeText() const
}
void AccessibilityMemo::SetBeforeText(const std::string &beforeText)
{}
{
(void)beforeText;
}
void AccessibilityMemo::AddContent(const std::string &content)
{}
{
(void)content;
}
std::vector<std::string> AccessibilityMemo::GetContentList() const
{
@ -123,7 +145,9 @@ std::string AccessibilityMemo::GetLatestContent() const
}
void AccessibilityMemo::SetLatestContent(const std::string &content)
{}
{
(void)content;
}
std::string AccessibilityMemo::GetDescription() const
{
@ -131,10 +155,14 @@ std::string AccessibilityMemo::GetDescription() const
}
void AccessibilityMemo::SetDescription(const std::string &contentDescription)
{}
{
(void)contentDescription;
}
void AccessibilityMemo::SetItemCounts(const int itemCounts)
{}
{
(void)itemCounts;
}
int AccessibilityMemo::GetItemCounts() const
{
@ -143,16 +171,19 @@ int AccessibilityMemo::GetItemCounts() const
bool AccessibilityEventInfo::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool AccessibilityEventInfo::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
AccessibilityEventInfo *AccessibilityEventInfo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
AccessibilityEventInfo *accessibilityEventInfo = new AccessibilityEventInfo();
return accessibilityEventInfo;
}
@ -163,10 +194,14 @@ int AccessibilityEventInfo::GetRecordCount() const
}
void AccessibilityEventInfo::SetRecordCount(const int recordCount)
{}
{
(void)recordCount;
}
void AccessibilityEventInfo::AddRecord(const AccessibilityEventInfo &record)
{}
{
(void)record;
}
AccessibilityEventInfo AccessibilityEventInfo::GetRecord(const int index)
{
@ -189,7 +224,9 @@ WindowsContentChangeTypes AccessibilityEventInfo::GetWindowContentChangeTypes()
}
void AccessibilityEventInfo::SetWindowContentChangeTypes(const WindowsContentChangeTypes changeTypes)
{}
{
(void)changeTypes;
}
WindowUpdateType AccessibilityEventInfo::GetWindowChangeTypes() const
{
@ -197,7 +234,9 @@ WindowUpdateType AccessibilityEventInfo::GetWindowChangeTypes() const
}
void AccessibilityEventInfo::SetWindowChangeTypes(const WindowUpdateType changeTypes)
{}
{
(void)changeTypes;
}
void AccessibilityEventInfo::SetEventType(const EventType eventType)
{
@ -210,7 +249,9 @@ long long AccessibilityEventInfo::GetTimeStamp() const
}
void AccessibilityEventInfo::SetTimeStamp(const long long eventTime)
{}
{
(void)eventTime;
}
std::string AccessibilityEventInfo::GetBundleName() const
{
@ -218,10 +259,14 @@ std::string AccessibilityEventInfo::GetBundleName() const
}
void AccessibilityEventInfo::SetBundleName(const std::string &bundleName)
{}
{
(void)bundleName;
}
void AccessibilityEventInfo::SetTextMovementStep(const TextMoveUnit granularity)
{}
{
(void)granularity;
}
TextMoveUnit AccessibilityEventInfo::GetTextMovementStep() const
{
@ -229,7 +274,9 @@ TextMoveUnit AccessibilityEventInfo::GetTextMovementStep() const
}
void AccessibilityEventInfo::SetTriggerAction(const ActionType action)
{}
{
(void)action;
}
ActionType AccessibilityEventInfo::GetTriggerAction() const
{
@ -237,13 +284,20 @@ ActionType AccessibilityEventInfo::GetTriggerAction() const
}
AccessibilityEventInfo::AccessibilityEventInfo(int windowId, WindowUpdateType windowChangeTypes)
{}
{
(void)windowId;
(void)windowChangeTypes;
}
AccessibilityEventInfo::AccessibilityEventInfo(EventType eventType)
{}
{
(void)eventType;
}
void AccessibilityEventInfo::SetNotificationInfo(const NotificationCategory category)
{}
{
(void)category;
}
NotificationCategory AccessibilityEventInfo::GetNotificationInfo() const
{

View File

@ -49,28 +49,35 @@ AccessibilityOperator &AccessibilityOperator::GetInstance()
sptr<IAccessibleAbilityChannel> AccessibilityOperator::GetChannel(int channelId)
{
(void)channelId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator GetChannel";
return nullptr;
}
void AccessibilityOperator::AddChannel(const int channelId, const sptr<IAccessibleAbilityChannel> &channel)
{
(void)channelId;
(void)channel;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator AddChannel";
}
void AccessibilityOperator::RemoveChannel(int channelId)
{
(void)channelId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator RemoveChannel";
}
bool AccessibilityOperator::GetRoot(int channelId, AccessibilityElementInfo &elementInfo)
{
(void)channelId;
(void)elementInfo;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator GetRoot";
return true;
}
std::vector<AccessibilityWindowInfo> AccessibilityOperator::GetWindows(int channelId)
{
(void)channelId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator GetWindows";
return windows_;
}
@ -78,6 +85,11 @@ std::vector<AccessibilityWindowInfo> AccessibilityOperator::GetWindows(int chann
bool AccessibilityOperator::SearchElementInfosByAccessibilityId(int channelId,
int accessibilityWindowId, int elementId, int mode, std::vector<AccessibilityElementInfo> &elementInfos)
{
(void)channelId;
(void)accessibilityWindowId;
(void)elementId;
(void)mode;
(void)elementInfos;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SearchElementInfosByAccessibilityId";
return true;
}
@ -86,6 +98,11 @@ bool AccessibilityOperator::SearchElementInfosByText(int channelId,
int accessibilityWindowId, int elementId, const std::string &text,
std::vector<AccessibilityElementInfo> &elementInfos)
{
(void)channelId;
(void)accessibilityWindowId;
(void)elementId;
(void)text;
(void)elementInfos;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SearchElementInfosByText";
return true;
}
@ -93,6 +110,11 @@ bool AccessibilityOperator::SearchElementInfosByText(int channelId,
bool AccessibilityOperator::FindFocusedElementInfo(int channelId, int accessibilityWindowId,
int elementId, int focusType, AccessibilityElementInfo &elementInfo)
{
(void)channelId;
(void)accessibilityWindowId;
(void)elementId;
(void)focusType;
(void)elementInfo;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator FindFocusedElementInfo";
return true;
}
@ -100,6 +122,11 @@ bool AccessibilityOperator::FindFocusedElementInfo(int channelId, int accessibil
bool AccessibilityOperator::FocusMoveSearch(int channelId, int accessibilityWindowId,
int elementId, int direction, AccessibilityElementInfo &elementInfo)
{
(void)channelId;
(void)accessibilityWindowId;
(void)elementId;
(void)direction;
(void)elementInfo;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator FocusMoveSearch";
return true;
}
@ -107,6 +134,11 @@ bool AccessibilityOperator::FocusMoveSearch(int channelId, int accessibilityWind
bool AccessibilityOperator::ExecuteAction(int channelId, int accessibilityWindowId,
int elementId, int action, std::map<std::string, std::string> &actionArguments)
{
(void)channelId;
(void)accessibilityWindowId;
(void)elementId;
(void)action;
(void)actionArguments;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator ExecuteAction";
return executeActionResult_;
}
@ -114,61 +146,84 @@ bool AccessibilityOperator::ExecuteAction(int channelId, int accessibilityWindow
void AccessibilityOperator::SetSearchElementInfoByAccessibilityIdResult(
const std::vector<AccessibilityElementInfo> &infos, const int requestId)
{
(void)infos;
(void)requestId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SetSearchElementInfoByAccessibilityIdResult";
}
void AccessibilityOperator::SetSearchElementInfoByTextResult(const std::vector<AccessibilityElementInfo> &infos,
const int requestId)
{
(void)infos;
(void)requestId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SetSearchElementInfoByTextResult";
}
void AccessibilityOperator::SetFindFocusedElementInfoResult(const AccessibilityElementInfo &info, const int requestId)
{
(void)info;
(void)requestId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SetFindFocusedElementInfoResult";
}
void AccessibilityOperator::SetFocusMoveSearchResult(const AccessibilityElementInfo &info, const int requestId)
{
(void)info;
(void)requestId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SetFocusMoveSearchResult";
}
void AccessibilityOperator::SetExecuteActionResult(const bool succeeded, const int requestId)
{
(void)succeeded;
(void)requestId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SetExecuteActionResult";
}
bool AccessibilityOperator::ExecuteCommonAction(const int channelId, const int action)
{
(void)channelId;
(void)action;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator ExecuteCommonAction";
return true;
}
void AccessibilityOperator::SetOnKeyPressEventResult(const int channelId, const bool handled, const int sequence)
{
(void)channelId;
(void)handled;
(void)sequence;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SetOnKeyPressEventResult";
}
float AccessibilityOperator::GetDisplayResizeScale(const int channelId, const int displayId)
{
(void)channelId;
(void)displayId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator GetDisplayResizeScale";
return 0;
}
float AccessibilityOperator::GetDisplayResizeCenterX(const int channelId, const int displayId)
{
(void)channelId;
(void)displayId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator GetDisplayResizeCenterX";
return 0;
}
float AccessibilityOperator::GetDisplayResizeCenterY(const int channelId, const int displayId)
{
(void)channelId;
(void)displayId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator GetDisplayResizeCenterY";
return 0;
}
Rect AccessibilityOperator::GetDisplayResizeRect(const int channelId, const int displayId)
{
(void)channelId;
(void)displayId;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator GetDisplayResizeRect";
Rect rect {};
rect.SetLeftTopScreenPostion(1, 1);
@ -177,6 +232,9 @@ Rect AccessibilityOperator::GetDisplayResizeRect(const int channelId, const int
bool AccessibilityOperator::ResetDisplayResize(const int channelId, const int displayId, const bool animate)
{
(void)channelId;
(void)displayId;
(void)animate;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator ResetDisplayResize";
return true;
}
@ -184,6 +242,12 @@ bool AccessibilityOperator::ResetDisplayResize(const int channelId, const int di
bool AccessibilityOperator::SetDisplayResizeScaleAndCenter(const int channelId,
const int displayId, const float scale, const float centerX, const float centerY, const bool animate)
{
(void)channelId;
(void)displayId;
(void)scale;
(void)centerX;
(void)centerY;
(void)animate;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SetDisplayResizeScaleAndCenter";
return true;
}
@ -191,6 +255,9 @@ bool AccessibilityOperator::SetDisplayResizeScaleAndCenter(const int channelId,
void AccessibilityOperator::SendSimulateGesture(const int channelId,
const int requestId, const std::vector<GesturePathDefine> &gestureSteps)
{
(void)channelId;
(void)requestId;
(void)gestureSteps;
GTEST_LOG_(INFO) << "MOCK AccessibilityOperator SendSimulateGesture";
}
} // namespace Accessibility

View File

@ -21,16 +21,19 @@ namespace OHOS {
namespace Accessibility {
bool AccessibilityWindowInfo::ReadFromParcel(Parcel &parcel)
{
(void)parcel;
return true;
}
bool AccessibilityWindowInfo::Marshalling(Parcel &parcel) const
{
(void)parcel;
return true;
};
AccessibilityWindowInfo* AccessibilityWindowInfo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
return nullptr;
}
@ -40,7 +43,9 @@ std::string AccessibilityWindowInfo::GetWindowTitle() const
}
void AccessibilityWindowInfo::SetWindowTitle(std::string &title)
{}
{
(void)title;
}
WindowType AccessibilityWindowInfo::GetWindowType() const
{
@ -48,7 +53,9 @@ WindowType AccessibilityWindowInfo::GetWindowType() const
}
void AccessibilityWindowInfo::SetWindowType(const WindowType type)
{}
{
(void)type;
}
int AccessibilityWindowInfo::GetWindowLayer() const
{
@ -56,10 +63,13 @@ int AccessibilityWindowInfo::GetWindowLayer() const
}
void AccessibilityWindowInfo::SetWindowLayer(const int layer)
{}
{
(void)layer;
}
bool AccessibilityWindowInfo::GetRootAccessibilityInfo(AccessibilityElementInfo &elementInfo)
{
(void)elementInfo;
return true;
}
@ -68,6 +78,7 @@ void AccessibilityWindowInfo::SetAnchorId(const int anchorId)
bool AccessibilityWindowInfo::GetAnchor(AccessibilityElementInfo &elementInfo)
{
(void)elementInfo;
return true;
}
@ -78,7 +89,9 @@ AccessibilityWindowInfo AccessibilityWindowInfo::GetParent()
}
void AccessibilityWindowInfo::SetParentId(const int parentId)
{}
{
(void)parentId;
}
int AccessibilityWindowInfo::GetParentId() const
{
@ -100,10 +113,14 @@ int AccessibilityWindowInfo::GetWindowId() const
}
void AccessibilityWindowInfo::SetWindowId(const int id)
{}
{
(void)id;
}
void AccessibilityWindowInfo::SetChannelId(const int channelId)
{}
{
(void)channelId;
}
int AccessibilityWindowInfo::GetChannelId() const
{
@ -116,7 +133,9 @@ Rect AccessibilityWindowInfo::GetRectInScreen() const
}
void AccessibilityWindowInfo::SetRectInScreen(const Rect &bounds)
{}
{
(void)bounds;
}
bool AccessibilityWindowInfo::IsActive() const
{
@ -124,7 +143,9 @@ bool AccessibilityWindowInfo::IsActive() const
}
void AccessibilityWindowInfo::SetActive(bool active)
{}
{
(void)active;
}
bool AccessibilityWindowInfo::IsFocused() const
{
@ -132,7 +153,9 @@ bool AccessibilityWindowInfo::IsFocused() const
}
void AccessibilityWindowInfo::SetFocused(bool focused)
{}
{
(void)focused;
}
bool AccessibilityWindowInfo::IsAccessibilityFocused() const
{
@ -140,7 +163,9 @@ bool AccessibilityWindowInfo::IsAccessibilityFocused() const
}
void AccessibilityWindowInfo::SetAccessibilityFocused(const bool accessibilityfocused)
{}
{
(void)accessibilityfocused;
}
int AccessibilityWindowInfo::GetChildNum() const
{
@ -149,12 +174,15 @@ int AccessibilityWindowInfo::GetChildNum() const
AccessibilityWindowInfo AccessibilityWindowInfo::GetChild(const int index)
{
(void)index;
AccessibilityWindowInfo accessibilityWindow {};
return accessibilityWindow;
}
void AccessibilityWindowInfo::AddChild(const int childId)
{}
{
(void)childId;
}
AccessibilityWindowInfo::AccessibilityWindowInfo()
{}

View File

@ -27,12 +27,17 @@ AccessibleAbilityChannelProxy::AccessibleAbilityChannelProxy(
bool AccessibleAbilityChannelProxy::WriteInterfaceToken(MessageParcel &data)
{
(void)data;
return true;
}
bool AccessibleAbilityChannelProxy::SendTransactCmd(IAccessibleAbilityChannel::Message code,
MessageParcel &data, MessageParcel &reply, MessageOption &option)
{
(void)code;
(void)data;
(void)reply;
(void)option;
return true;
}
@ -40,6 +45,11 @@ bool AccessibleAbilityChannelProxy::SearchElementInfoByAccessibilityId(const int
const long elementId, const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback,
const int mode)
{
(void)accessibilityWindowId;
(void)elementId;
(void)requestId;
(void)callback;
(void)mode;
return true;
}
@ -47,6 +57,11 @@ bool AccessibleAbilityChannelProxy::SearchElementInfosByText(const int accessibi
const long elementId, const std::string &text, const int requestId,
const sptr<IAccessibilityElementOperatorCallback> &callback)
{
(void)accessibilityWindowId;
(void)elementId;
(void)text;
(void)requestId;
(void)callback;
return true;
}
@ -54,12 +69,22 @@ bool AccessibleAbilityChannelProxy::FindFocusedElementInfo(const int accessibili
const long elementId, const int focusType, const int requestId,
const sptr<IAccessibilityElementOperatorCallback> &callback)
{
(void)accessibilityWindowId;
(void)elementId;
(void)focusType;
(void)requestId;
(void)callback;
return true;
}
bool AccessibleAbilityChannelProxy::FocusMoveSearch(const int accessibilityWindowId, const long elementId,
const int direction, const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback)
{
(void)accessibilityWindowId;
(void)elementId;
(void)direction;
(void)requestId;
(void)callback;
return true;
}
@ -67,6 +92,12 @@ bool AccessibleAbilityChannelProxy::ExecuteAction(const int accessibilityWindowI
const int action, std::map<std::string, std::string> &actionArguments, const int requestId,
const sptr<IAccessibilityElementOperatorCallback> &callback)
{
(void)accessibilityWindowId;
(void)elementId;
(void)action;
(void)actionArguments;
(void)requestId;
(void)callback;
return true;
}
@ -78,45 +109,64 @@ vector<AccessibilityWindowInfo> AccessibleAbilityChannelProxy::GetWindows()
bool AccessibleAbilityChannelProxy::ExecuteCommonAction(const int action)
{
(void)action;
return true;
}
void AccessibleAbilityChannelProxy::SetOnKeyPressEventResult(const bool handled, const int sequence)
{}
{
(void)handled;
(void)sequence;
}
float AccessibleAbilityChannelProxy::GetDisplayResizeScale(const int displayId)
{
(void)displayId;
return 0;
}
float AccessibleAbilityChannelProxy::GetDisplayResizeCenterX(const int displayId)
{
(void)displayId;
return 0;
}
float AccessibleAbilityChannelProxy::GetDisplayResizeCenterY(const int displayId)
{
(void)displayId;
return 0;
}
Rect AccessibleAbilityChannelProxy::GetDisplayResizeRect(const int displayId)
{
(void)displayId;
Rect rect(0, 0, 0, 0);
return rect;
}
bool AccessibleAbilityChannelProxy::ResetDisplayResize(const int displayId, const bool animate)
{
(void)displayId;
(void)animate;
return true;
}
bool AccessibleAbilityChannelProxy::SetDisplayResizeScaleAndCenter(const int displayId, const float scale,
const float centerX, const float centerY, const bool animate)
{
(void)displayId;
(void)scale;
(void)centerX;
(void)centerY;
(void)animate;
return true;
}
void AccessibleAbilityChannelProxy::SendSimulateGesture(
const int requestId, const std::vector<GesturePathDefine> &gestureSteps) {}
const int requestId, const std::vector<GesturePathDefine> &gestureSteps)
{
(void)requestId;
(void)gestureSteps;
}
} // namespace Accessibility
} // namespace OHOS

View File

@ -30,6 +30,11 @@ bool MockAccessibleAbilityChannel::SearchElementInfoByAccessibilityId(const int
const sptr<IAccessibilityElementOperatorCallback> &callback, const int mode)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::SearchElementInfoByAccessibilityId start";
(void)accessibilityWindowId;
(void)elementId;
(void)requestId;
(void)callback;
(void)mode;
return true;
}
@ -37,6 +42,11 @@ bool MockAccessibleAbilityChannel::SearchElementInfosByText(const int accessibil
const std::string &text, const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::SearchElementInfosByText start";
(void)accessibilityWindowId;
(void)elementId;
(void)text;
(void)requestId;
(void)callback;
return true;
}
@ -44,6 +54,11 @@ bool MockAccessibleAbilityChannel::FindFocusedElementInfo(const int accessibilit
const int focusType, const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::FindFocusedElementInfo start";
(void)accessibilityWindowId;
(void)elementId;
(void)focusType;
(void)requestId;
(void)callback;
return true;
}
@ -51,6 +66,11 @@ bool MockAccessibleAbilityChannel::FocusMoveSearch(const int accessibilityWindow
const int direction, const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::FocusMoveSearch start";
(void)accessibilityWindowId;
(void)elementId;
(void)direction;
(void)requestId;
(void)callback;
return true;
}
@ -59,6 +79,12 @@ bool MockAccessibleAbilityChannel::ExecuteAction(const int accessibilityWindowId
const int requestId, const sptr<IAccessibilityElementOperatorCallback> &callback)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::ExecuteAction start";
(void)accessibilityWindowId;
(void)elementId;
(void)action;
(void)actionArguments;
(void)requestId;
(void)callback;
return true;
}
@ -72,35 +98,42 @@ std::vector<AccessibilityWindowInfo> MockAccessibleAbilityChannel::GetWindows()
bool MockAccessibleAbilityChannel::ExecuteCommonAction(const int action)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::ExecuteCommonAction start";
(void)action;
return true;
}
void MockAccessibleAbilityChannel::SetOnKeyPressEventResult(const bool handled, const int sequence)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::SetOnKeyPressEventResult start";
(void)handled;
(void)sequence;
}
float MockAccessibleAbilityChannel::GetDisplayResizeScale(const int displayId)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::GetDisplayResizeScale start";
(void)displayId;
return 1.0f;
}
float MockAccessibleAbilityChannel::GetDisplayResizeCenterX(const int displayId)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::GetDisplayResizeCenterX start";
(void)displayId;
return 1.0f;
}
float MockAccessibleAbilityChannel::GetDisplayResizeCenterY(const int displayId)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::GetDisplayResizeCenterY start";
(void)displayId;
return 1.0f;
}
Rect MockAccessibleAbilityChannel::GetDisplayResizeRect(const int displayId)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::GetDisplayResizeRect start";
(void)displayId;
Rect rect(RECT_ONE, RECT_TWO, RECT_THREE, RECT_FOUR);
return rect;
}
@ -108,6 +141,8 @@ Rect MockAccessibleAbilityChannel::GetDisplayResizeRect(const int displayId)
bool MockAccessibleAbilityChannel::ResetDisplayResize(const int displayId, const bool animate)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::ResetDisplayResize start";
(void)displayId;
(void)animate;
return true;
}
@ -115,6 +150,11 @@ bool MockAccessibleAbilityChannel::SetDisplayResizeScaleAndCenter(const int disp
const float scale, const float centerX, const float centerY, const bool animate)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::SetDisplayResizeScaleAndCenter start";
(void)displayId;
(void)scale;
(void)centerX;
(void)centerY;
(void)animate;
return true;
}
@ -122,6 +162,8 @@ void MockAccessibleAbilityChannel::SendSimulateGesture(const int requestId,
const std::vector<GesturePathDefine> &gestureSteps)
{
GTEST_LOG_(INFO) << "MockAccessibleAbilityChannel::SendSimulateGesture start";
(void)requestId;
(void)gestureSteps;
}
sptr<IRemoteObject> MockAccessibleAbilityChannel::AsObject()

View File

@ -50,7 +50,7 @@ public:
void AccessibilityAbilityInfoUnitTest::WritefileAll(const char* fname, const char* data)
{
FILE *fp;
if ((fp = fopen(fname, "w")) == NULL) {
if ((fp = fopen(fname, "w")) == nullptr) {
printf("open file %s fail \n", fname);
return;
}
@ -179,7 +179,7 @@ HWTEST_F(AccessibilityAbilityInfoUnitTest, AccessibilityAbilityInfo_Unittest_Get
HWTEST_F(AccessibilityAbilityInfoUnitTest, AccessibilityAbilityInfo_Unittest_GetEventTypes_001, TestSize.Level1)
{
GTEST_LOG_(INFO) << "AccessibilityAbilityInfo_Unittest_GetEventTypes_001 start";
uint32_t eventType = 0; // (uint32_t)EventType::TYPES_ALL_MASK
uint32_t eventType = EventType::TYPES_ALL_MASK;
EXPECT_EQ(accessibilityAbilityInfo_->GetEventTypes(), eventType);
GTEST_LOG_(INFO) << "AccessibilityAbilityInfo_Unittest_GetEventTypes_001 end";

View File

@ -25,29 +25,42 @@ class KeyEvent;
namespace Accessibility {
class IAccessibleUITestAbilityListener {
public:
virtual void OnAbilityConnected() = 0;
/**
* @brief Called when an accessibility event occurs.
* @param eventInfo The information of accessible event.
* @return
*/
virtual void OnAccessibilityEvent(const AccessibilityEventInfo &eventInfo) = 0;
/**
* @brief Called when an accessibility is connected.
* @param
* @return
*/
virtual void OnAbilityConnected() = 0;
/**
* @brief Called when a key event occurs.
* @param keyEvent Indicates the key event to send.
* @param sequence The sequence of the key event.
* @return
*/
virtual bool OnKeyPressEvent(const std::shared_ptr<MMI::KeyEvent> &keyEvent, const int sequence) = 0;
/**
* @brief Called when an accessibility is disconnected.
* @param
* @return
*/
virtual void OnAbilityDisconnected() = 0;
/**
* @brief Called when need to notify the result of simulation gesture.
* @param sequence The sequence of gesture.
* @param completedSuccessfully The result of gesture completion.
* @return
*/
virtual void OnGestureSimulateResult(const int sequence, const bool completedSuccessfully) = 0;
/**
* @brief Called when an accessibility event occurs.
* @param eventInfo The information of accessible event.
* @return
*/
virtual void OnAccessibilityEvent(const AccessibilityEventInfo &eventInfo) = 0;
/**
* @brief Called when a key event occurs.
* @param keyEvent Indicates the key event to send.
* @param sequence The sequence of the key event.
* @return
*/
virtual bool OnKeyPressEvent(const std::shared_ptr<MMI::KeyEvent> &keyEvent, const int sequence) = 0;
/**
* @brief Called when need to notify the result of simulation gesture.
* @param sequence The sequence of gesture.
* @param completedSuccessfully The result of gesture completion.
* @return
*/
virtual void OnGestureSimulateResult(const int sequence, const bool completedSuccessfully) = 0;
};
} // namespace Accessibility
} // namespace OHOS

View File

@ -332,10 +332,13 @@ napi_value NElementInfo::GetNext(napi_env env, napi_callback_info info)
napi_value thisVar;
void* data = nullptr;
AccessibilityElementInfo* nodeInfo = nullptr;
bool ret = true;
NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisVar, &data));
std::string direction;
ParseString(env, direction, argv[PARAM0]);
if (!ParseString(env, direction, argv[PARAM0]) || direction == "") {
ret = false;
}
HILOG_DEBUG("argc = %{public}d", (int)argc);
HILOG_INFO("direction[%{public}s]", direction.c_str());
@ -347,6 +350,7 @@ napi_value NElementInfo::GetNext(napi_env env, napi_callback_info info)
NAccessibilityInfoData *callbackInfo = new NAccessibilityInfoData();
callbackInfo->nativeNodeInfo_ = *nodeInfo;
callbackInfo->content_ = direction;
callbackInfo->ret_ = ret;
napi_value promise = nullptr;
if (argc > ARGS_SIZE_ONE) {
HILOG_DEBUG("GetNext callback mode");
@ -364,8 +368,10 @@ napi_value NElementInfo::GetNext(napi_env env, napi_callback_info info)
[](napi_env env, void* data) { // execute async to call c++ function
NAccessibilityInfoData *callbackInfo = (NAccessibilityInfoData*)data;
AccessibilityElementInfo nodeInfo = callbackInfo->nativeNodeInfo_;
callbackInfo->ret_ = nodeInfo.GetNext(CovertStringToDirection(callbackInfo->content_),
callbackInfo->nodeInfo_);
if (callbackInfo->ret_) {
callbackInfo->ret_ = nodeInfo.GetNext(CovertStringToDirection(callbackInfo->content_),
callbackInfo->nodeInfo_);
}
},
[](napi_env env, napi_status status, void* data) { // execute the complete function
HILOG_DEBUG("GetNext execute back");

View File

@ -303,71 +303,35 @@ napi_value NAccessibilityClient::UnsubscribeState(napi_env env, napi_callback_in
size_t argc = ARGS_SIZE_TWO;
napi_value args[ARGS_SIZE_TWO] = {0};
napi_get_cb_info(env, info, &argc, args, nullptr, nullptr);
std::string eventType = GetStringFromNAPI(env, args[0]);
std::string eventType = GetStringFromNAPI(env, args[PARAM0]);
AccessibilityStateEventType type = AccessibilityStateEventType::EVENT_ACCESSIBILITY_STATE_CHANGED;
if (!std::strcmp(eventType.c_str(), "accessibilityStateChange")) {
type = AccessibilityStateEventType::EVENT_ACCESSIBILITY_STATE_CHANGED;
} else if (!std::strcmp(eventType.c_str(), "touchGuideStateChange")) {
type = AccessibilityStateEventType::EVENT_TOUCH_GUIDE_STATE_CHANGED;
} else {
HILOG_ERROR("SubscribeState eventType[%{public}s] is error", eventType.c_str());
}
int i = 0;
bool result = false;
for (auto observer : NAccessibilityClient::listeners_) {
if (observer->GetEnv() == env && !strcmp(observer->GetEventType().c_str(), eventType.c_str())) {
result = AccessibilitySystemAbilityClient::GetInstance()->UnsubscribeStateObserver(observer, type);
NAccessibilityClient::listeners_.erase(NAccessibilityClient::listeners_.begin() + i);
break;
}
i++;
}
if (argc > ARGS_SIZE_ONE) {
HILOG_DEBUG("UnsubscribeState callback mode %{public}d", NAccessibilityClient::listeners_.size());
NAccessibilitySystemAbilityClient* callbackInfo = new NAccessibilitySystemAbilityClient();
napi_create_reference(env, args[1], 1, &callbackInfo->callback_);
napi_value resource = nullptr;
napi_create_string_utf8(env, "off", NAPI_AUTO_LENGTH, &resource);
callbackInfo->eventType_ = eventType;
callbackInfo->stateListener_ = NAccessibilityClient::listeners_;
// async to sync start
AccessibilityStateEventType type = AccessibilityStateEventType::EVENT_ACCESSIBILITY_STATE_CHANGED;
std::string eventType = callbackInfo->eventType_;
if (!std::strcmp(eventType.c_str(), "accessibilityStateChange")) {
type = AccessibilityStateEventType::EVENT_ACCESSIBILITY_STATE_CHANGED;
} else if (!std::strcmp(eventType.c_str(), "touchGuideStateChange")) {
type = AccessibilityStateEventType::EVENT_TOUCH_GUIDE_STATE_CHANGED;
} else {
HILOG_ERROR("SubscribeState eventType[%{public}s] is error", eventType.c_str());
}
int i = 0;
for (auto observer : NAccessibilityClient::listeners_) {
if (observer->GetEnv() == env && !strcmp(observer->GetEventType().c_str(), eventType.c_str())) {
callbackInfo->result_ =
AccessibilitySystemAbilityClient::GetInstance()->UnsubscribeStateObserver(observer, type);
NAccessibilityClient::listeners_.erase(NAccessibilityClient::listeners_.begin() + i);
HILOG_INFO("unregister result%{public}d", callbackInfo->result_);
break;
}
i++;
}
napi_value result[ARGS_SIZE_TWO] = {0};
napi_value callback = 0;
if (argc == ARGS_SIZE_TWO) {
napi_value jsEvent;
napi_get_boolean(env, result, &jsEvent);
napi_value callResult;
napi_value undefined = 0;
napi_get_undefined(env, &undefined);
napi_get_boolean(env, callbackInfo->result_, &result[PARAM1]);
if (callbackInfo->callback_) {
result[PARAM0] = GetErrorValue(env, CODE_SUCCESS);
napi_get_reference_value(env, callbackInfo->callback_, &callback);
napi_value returnVal;
napi_call_function(env, undefined, callback, ARGS_SIZE_TWO, result, &returnVal);
napi_delete_reference(env, callbackInfo->callback_);
} else {
HILOG_ERROR("SubscribeState end eventType[%{public}s] is error", callbackInfo->eventType_.c_str());
}
// async to sync end
} else {
AccessibilityStateEventType type = AccessibilityStateEventType::EVENT_ACCESSIBILITY_STATE_CHANGED;
if (!std::strcmp(eventType.c_str(), "accessibility")) {
type = AccessibilityStateEventType::EVENT_ACCESSIBILITY_STATE_CHANGED;
} else if (!std::strcmp(eventType.c_str(), "touchExplorer")) {
type = AccessibilityStateEventType::EVENT_TOUCH_GUIDE_STATE_CHANGED;
} else {
HILOG_ERROR("SubscribeState eventType[%{public}s] is error", eventType.c_str());
}
int i = 0;
for (auto observer : NAccessibilityClient::listeners_) {
if (observer->GetEnv() == env && !strcmp(observer->GetEventType().c_str(), eventType.c_str())) {
AccessibilitySystemAbilityClient::GetInstance()->UnsubscribeStateObserver(observer, type);
NAccessibilityClient::listeners_.erase(NAccessibilityClient::listeners_.begin() + i);
break;
}
i++;
}
napi_call_function(env, undefined, args[PARAM1], ARGS_SIZE_ONE, &jsEvent, &callResult);
}
return nullptr;
}
@ -1598,7 +1562,7 @@ napi_value NAccessibilityClient::DeregisterCaptionStateCallback(napi_env env, na
if (type == CaptionObserverType::CAPTION_ENABLE) {
napi_get_boolean(env, callbackInfo->result_, &result[PARAM0]); // maby rework
} else {
napi_create_object(env, &result[PARAM0]); // maby rework
napi_create_object(env, &result[PARAM0]); // maby rework
OHOS::Accessibility::CaptionProperty captionProperty {};
captionProperty = AccessibilitySystemAbilityClient::GetInstance()->GetCaptionProperty();
ConvertCaptionPropertyToJS(env, result[PARAM0], captionProperty);

View File

@ -146,7 +146,7 @@ private:
};
bool IsWantedEvent(int eventType);
bool IsWhiteListEvent(EventType eventType);
bool IsAllowedListEvent(EventType eventType);
sptr<IRemoteObject::DeathRecipient> deathRecipient_ {};
sptr<IAccessibleAbilityClient> proxy_ = nullptr;

View File

@ -247,7 +247,6 @@ void AccessibilityAccountData::RemoveEnabledAbility(const AppExecFwk::ElementNam
enabledAbilities_.erase(it);
}
RemoveEnabledFromPref(elementName.GetBundleName());
DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->UpdateAbilities();
}
// For UT
@ -270,13 +269,12 @@ void AccessibilityAccountData::RemoveInstalledAbility(std::string bundleName)
HILOG_DEBUG("start.");
for (auto it = installedAbilities_.begin(); it != installedAbilities_.end();) {
if (it->GetPackageName() == bundleName) {
HILOG_DEBUG("Removed %{public}s from InstalledAbility: ", bundleName.c_str());
installedAbilities_.erase(it);
} else {
++it;
}
}
DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->UpdateAbilities();
}
void AccessibilityAccountData::ClearInstalledAbility()
@ -664,6 +662,10 @@ bool AccessibilityAccountData::GetInstalledAbilitiesFromBMS()
void AccessibilityAccountData::CaptionInit(const std::shared_ptr<NativePreferences::Preferences> &pref)
{
HILOG_DEBUG("start.");
if (pref == nullptr) {
HILOG_ERROR("Input Parameter is nullptr");
return;
}
std::string strValue = pref->GetString("CaptionState", "");
HILOG_DEBUG(" pref->GetString() = %{public}s.", strValue.c_str());
@ -702,6 +704,10 @@ void AccessibilityAccountData::CaptionInit(const std::shared_ptr<NativePreferenc
void AccessibilityAccountData::CapbilityInit(const std::shared_ptr<NativePreferences::Preferences> &pref)
{
HILOG_DEBUG("start.");
if (pref == nullptr) {
HILOG_ERROR("Input Parameter is nullptr");
return;
}
std::string strValue = pref->GetString("accessible", "");
HILOG_DEBUG("strValue = %{public}s", strValue.c_str());
@ -741,6 +747,11 @@ void AccessibilityAccountData::CapbilityInit(const std::shared_ptr<NativePrefere
void AccessibilityAccountData::EnabledListInit(const std::shared_ptr<NativePreferences::Preferences> &pref)
{
HILOG_DEBUG("start.");
if (pref == nullptr) {
HILOG_ERROR("Input Parameter is nullptr");
return;
}
std::string BundleName = "";
AccessibilityAbilityInfo abilityInfo;
@ -822,10 +833,10 @@ bool AccessibilityAccountData::DisableAbilities(std::map<std::string, AppExecFwk
{
HILOG_DEBUG("start.");
for (auto &disableAbility : it) {
HILOG_DEBUG("DisableAbilities URI(%{public}s)", disableAbility.first.c_str());
enabledAbilities_.erase(disableAbility.first);
RemoveEnabledFromPref(disableAbility.second.GetBundleName());
}
DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->UpdateAbilities();
return true;
}

View File

@ -51,6 +51,10 @@ AccessibilityGestureRecognizer::AccessibilityGestureRecognizer()
AccessibilityDisplayManager &displayMgr = AccessibilityDisplayManager::GetInstance();
auto display = displayMgr.GetDefaultDisplay();
if (display == nullptr) {
HILOG_ERROR("get display is nullptr");
return;
}
threshold_ = CALCULATION_DIMENSION(display->GetWidth());
xMinPixels_ = MIN_PIXELS(display->GetWidth());
@ -63,12 +67,12 @@ AccessibilityGestureRecognizer::AccessibilityGestureRecognizer()
runner_ = DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->GetMainRunner();
if (!runner_) {
HILOG_ERROR("get runner failed");
return ;
return;
}
handler_ = std::make_shared<GestureHandler>(runner_, *this);
if (!handler_) {
HILOG_ERROR("create event handler failed");
return ;
return;
}
}

View File

@ -306,7 +306,7 @@ void AccessibleAbilityConnection::OnAbilityConnectDone(const AppExecFwk::Element
HILOG_DEBUG("Connect failed!");
accountData_->RemoveEnabledAbility(elementName_);
accountData_->RemoveConnectingA11yAbility(elementName_);
DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->UpdateAbilities();
// temp deal: Notify setting
return;
}
@ -361,6 +361,7 @@ void AccessibleAbilityConnection::OnAbilityDisconnectDone(const AppExecFwk::Elem
sptr<AccessibleAbilityConnection> pointer = this;
accountData_->RemoveConnectedAbility(pointer);
accountData_->RemoveEnabledAbility(element);
DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->UpdateAbilities();
int32_t currentAccountId = DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->GetCurrentAccountId();
if (accountData_->GetAccountId() == currentAccountId) {
@ -377,8 +378,8 @@ void AccessibleAbilityConnection::OnAccessibilityEvent(AccessibilityEventInfo &e
}
bool send = false;
if (IsWhiteListEvent(eventInfo.GetEventType())) {
HILOG_DEBUG("Get event type is white list!");
if (IsAllowedListEvent(eventInfo.GetEventType())) {
HILOG_DEBUG("EventType is in the allowed list!");
send = true;
} else {
vector<std::string> filterBundleNames = abilityInfo_.GetFilterBundleNames();
@ -400,7 +401,7 @@ void AccessibleAbilityConnection::OnAccessibilityEvent(AccessibilityEventInfo &e
return;
}
bool AccessibleAbilityConnection::IsWhiteListEvent(EventType eventType)
bool AccessibleAbilityConnection::IsAllowedListEvent(EventType eventType)
{
bool ret = false;
switch (eventType) {
@ -540,6 +541,7 @@ void AccessibleAbilityConnection::AccessibleAbilityConnectionDeathRecipient::OnR
accountData->GetAccessibleAbilityConnection(recipientElementName_.GetURI());
accountData->RemoveConnectedAbility(connection);
accountData->RemoveEnabledAbility(recipientElementName_);
DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->UpdateAbilities();
DelayedSingleton<AccessibleAbilityManagerService>::GetInstance()->UpdateAccessibilityManagerService();
// temp deal: notify setting
}

View File

@ -542,6 +542,7 @@ void AccessibleAbilityManagerService::PackageRemoved(std::string& bundleName)
}
if (needUpdateAbility) {
UpdateAbilities();
UpdateAccessibilityManagerService();
}
}
@ -983,7 +984,7 @@ void AccessibleAbilityManagerService::RemoveUITestClient(sptr<AccessibleAbilityC
// remove installed ability
currentAccountData->RemoveInstalledAbility("com.example.uitest");
UpdateAbilities();
// remove connected ability
currentAccountData->RemoveUITestConnectedAbility(connection);
connection->OnAbilityDisconnectDone(connection->GetElementName(), 0);

View File

@ -1029,16 +1029,8 @@ group("unittest") {
deps = []
deps += [
":accessibility_account_data_test",
":accessibility_common_event_registry_test",
":accessibility_display_manager_test",
":accessibility_input_interceptor_test",
":accessibility_interaction_bridge_test",
":accessibility_keyevent_filter_test",
":accessibility_touchEvent_injector_test",
":accessibility_touch_guider_test",
":accessibility_window_manager_test",
":accessible_ability_connection_test",
":accessible_ability_manager_service_test",
]
}

View File

@ -40,27 +40,29 @@ Display::~Display()
DisplayId Display::GetId() const
{
return pImpl_->GetDisplayInfo()->GetDisplayId();
DisplayId id {0};
return id;
}
int32_t Display::GetWidth() const
{
return pImpl_->GetDisplayInfo()->GetWidth();
return 0;
}
int32_t Display::GetHeight() const
{
return pImpl_->GetDisplayInfo()->GetHeight();
return 0;
}
uint32_t Display::GetRefreshRate() const
{
return pImpl_->GetDisplayInfo()->GetRefreshRate();
return 0;
}
ScreenId Display::GetScreenId() const
{
return pImpl_->GetDisplayInfo()->GetScreenId();
ScreenId id {0};
return id;
}
void Display::UpdateDisplayInfo(sptr<DisplayInfo> displayInfo) const

View File

@ -60,7 +60,8 @@ DisplayId DisplayManager::GetDefaultDisplayId()
sptr<Display> DisplayManager::GetDisplayById(DisplayId displayId)
{
return nullptr;
sptr<Display> display = new Display("display_mock", nullptr);
return display;
}
std::shared_ptr<Media::PixelMap> DisplayManager::GetScreenshot(DisplayId displayId)

View File

@ -703,6 +703,9 @@ HWTEST_F(AccessibilityAccountDataTest, AccessibilityAccountData_Unittest_OnAccou
// new abilityInfo
AppExecFwk::ExtensionAbilityInfo info;
sptr<AccessibilityAbilityInfo> abilityInfo = new AccessibilityAbilityInfo(info);
abilityInfo->SetCapabilityValues(
CAPABILITY_RETRIEVE | CAPABILITY_TOUCH_GUIDE | CAPABILITY_GESTURE |
CAPABILITY_KEY_EVENT_OBSERVER | CAPABILITY_ZOOM);
// new AAconnection
sptr<AccessibleAbilityConnection> AAConnection = new AccessibleAbilityConnection(accountData, 0, *abilityInfo);
// new aastub

View File

@ -55,7 +55,7 @@ void AccessibilityCommonEventRegistryUnitTest::TearDownTestCase()
void AccessibilityCommonEventRegistryUnitTest::SetUp()
{
GTEST_LOG_(INFO) << "SetUp";
// 注册bundleservice
// register bundleservice
mock_ = new OHOS::AppExecFwk::BundleMgrService();
sptr<ISystemAbilityManager> systemAbilityManager =
SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();

View File

@ -131,7 +131,7 @@ HWTEST_F(AccessibilityInteractionBridgeTest, GetPointerItermOfAccessibilityFocus
Rect rect(0, 100, 800, 900);
AccessibilityWindowInfoManager::GetInstance().SetWindowSize(0, rect);
GTEST_LOG_(INFO) << "3 start";
auto interactionBridge = AccessibilityInteractionBridge::GetInstance();
auto &interactionBridge = AccessibilityInteractionBridge::GetInstance();
MMI::PointerEvent::PointerItem point;
auto ret = interactionBridge.GetPointerItermOfAccessibilityFocusClick(point);
EXPECT_EQ(ret, true);

View File

@ -181,7 +181,7 @@ HWTEST_F(AccessibleAbilityConnectionUnitTest,
{
GTEST_LOG_(INFO) << "AccessibleAbilityConnection_Unittest_OnAccessibilityEvent_001 start";
AccessibilityEventInfo eventInfo;
/* EventType is white list */
/* EventType is in the allowed list */
eventInfo.SetEventType(EventType::TYPE_PAGE_STATE_UPDATE);
connection_->OnAccessibilityEvent(eventInfo);
EXPECT_EQ(int(EventType::TYPE_PAGE_STATE_UPDATE), g_testEventType);
@ -199,7 +199,7 @@ HWTEST_F(AccessibleAbilityConnectionUnitTest,
{
GTEST_LOG_(INFO) << "AccessibleAbilityConnection_Unittest_OnAccessibilityEvent_002 start";
AccessibilityEventInfo eventInfo;
/* EventType not white list */
/* EventType is in the allowed list */
eventInfo.SetEventType(EventType::TYPE_VIEW_CLICKED_EVENT);
/* invalid window */
eventInfo.SetWindowId(3);

View File

@ -63,7 +63,7 @@ void AccessibleAbilityManagerServiceUnitTest::TearDownTestCase()
void AccessibleAbilityManagerServiceUnitTest::SetUp()
{
GTEST_LOG_(INFO) << "AccessibleAbilityManagerServiceUnitTest SetUp";
// 注册bundleservice
// register bundleservice
mock_ = new OHOS::AppExecFwk::BundleMgrService();
sptr<ISystemAbilityManager> systemAbilityManager =
SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();

View File

@ -30,7 +30,6 @@ config("module_private_config") {
include_dirs = aams_mock_include_dirs
include_dirs += [
"mock/aafwk/include",
"mock/powermanager/include",
"../aams/test/mock/",
"//third_party/json/include",
"//utils/native/base/include",
@ -56,8 +55,6 @@ config("module_private_config") {
"//foundation/appexecfwk/standard/kits/appkit/native/app/include",
"//base/global/resmgr_standard/interfaces/innerkits/include",
#"//foundation/distributedschedule/samgr/services/samgr/native/include",
#"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy/include",
"//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base/include",
"//foundation/appexecfwk/standard/common/log/include",
"//third_party/jsoncpp/include/json",
@ -81,14 +78,9 @@ config("module_private_config") {
]
}
MockPowerManagerSrc = [ "mock/powermanager/src/mock_power_mgr_client.cpp" ]
MockAafwkSrc = [ "mock/aafwk/src/mock_ability_manager_client.cpp" ]
MockDistributedscheduleSrc = [
#"mock/distributedschedule/src/iservice_registry.cpp",
#"mock/distributedschedule/src/system_ability_manager.cpp",
]
MockDistributedscheduleSrc = []
################################################################################
ohos_moduletest("aams_accessibility_touch_guider_test") {
@ -140,7 +132,7 @@ ohos_moduletest("aams_accessibility_touch_guider_test") {
sources += aams_mock_distributeddatamgr_src
sources += aams_mock_multimodalinput_src
sources += MockPowerManagerSrc
sources += aams_mock_powermanager_src
sources += MockAafwkSrc
sources += MockDistributedscheduleSrc
@ -226,7 +218,7 @@ ohos_moduletest("aams_accessibility_touchEvent_injector_test") {
sources += aams_mock_distributeddatamgr_src
sources += aams_mock_multimodalinput_src
sources += MockPowerManagerSrc
sources += aams_mock_powermanager_src
sources += MockAafwkSrc
sources += MockDistributedscheduleSrc
@ -305,13 +297,9 @@ ohos_moduletest("aams_accessible_ability_channel_test") {
"//base/accessibility/services/test/mock/common_event_manager_mock.cpp",
"//base/accessibility/services/test/mock/common_event_subscribe_info_mock.cpp",
"//base/accessibility/services/test/mock/common_event_subscriber_mock.cpp",
#"//base/accessibility/services/test/mock/mock_system_ability_manager_stub.cpp",
"//base/accessibility/services/test/mock/common_event_support_mock.cpp",
"//base/accessibility/services/test/mock/gesture_simulation_mock.cpp",
"//base/accessibility/services/test/mock/matching_skill_mock.cpp",
#"//base/accessibility/services/test/mock/system_ability_manager.cpp",
"//base/accessibility/services/test/mock/mock_bundle_manager.cpp",
"//base/accessibility/services/test/mock/mock_bundle_mgr_proxy.cpp",
"//base/accessibility/services/test/mock/mock_display.cpp",
@ -324,7 +312,7 @@ ohos_moduletest("aams_accessible_ability_channel_test") {
sources += aams_mock_distributeddatamgr_src
sources += aams_mock_multimodalinput_src
sources += MockPowerManagerSrc
sources += aams_mock_powermanager_src
sources += MockAafwkSrc
sources += MockDistributedscheduleSrc
@ -336,8 +324,6 @@ ohos_moduletest("aams_accessible_ability_channel_test") {
"//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler",
"//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk",
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
#"//foundation/distributedschedule/samgr/interfaces/innerkits/common:samgr_common",
"//foundation/windowmanager/utils:libwmutil",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
@ -399,13 +385,9 @@ ohos_moduletest("aams_server_test") {
"../aams/test/mock/common_event_manager_mock.cpp",
"../aams/test/mock/common_event_subscribe_info_mock.cpp",
"../aams/test/mock/common_event_subscriber_mock.cpp",
#"../aams/test/mock/mock_system_ability_manager_stub.cpp",
"../aams/test/mock/common_event_support_mock.cpp",
"../aams/test/mock/gesture_simulation_mock.cpp",
"../aams/test/mock/matching_skill_mock.cpp",
#"../aams/test/mock/system_ability_manager.cpp",
"../aams/test/mock/mock_bundle_manager.cpp",
"//base/accessibility/services/test/mock/accessibility_caption_mock.cpp",
"//base/accessibility/services/test/mock/mock_bundle_mgr_proxy.cpp",
@ -424,7 +406,7 @@ ohos_moduletest("aams_server_test") {
sources += aams_mock_distributeddatamgr_src
sources += aams_mock_multimodalinput_src
sources += MockPowerManagerSrc
sources += aams_mock_powermanager_src
sources += MockAafwkSrc
sources += MockDistributedscheduleSrc
@ -436,8 +418,6 @@ ohos_moduletest("aams_server_test") {
"//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler",
"//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk",
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
#"//foundation/distributedschedule/samgr/interfaces/innerkits/common:samgr_common",
"//foundation/windowmanager/utils:libwmutil",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
@ -512,7 +492,7 @@ ohos_moduletest("aams_accessibility_keyevent_filter_test") {
sources += aams_mock_distributeddatamgr_src
sources += aams_mock_multimodalinput_src
sources += MockPowerManagerSrc
sources += aams_mock_powermanager_src
sources += MockAafwkSrc
sources += MockDistributedscheduleSrc
@ -570,8 +550,6 @@ ohos_moduletest("aams_common_event_registry_test") {
"../aams/src/accessible_ability_manager_service.cpp",
"../aams/src/accessible_ability_manager_service_event_handler.cpp",
"//base/accessibility/services/test/mock/accessibility_ability_info_mock.cpp",
#"//base/accessibility/services/test/mock/ability_manager_client_mock.cpp",
"//base/accessibility/services/test/mock/accessibility_caption_mock.cpp",
"//base/accessibility/services/test/mock/accessibility_element_operator_callback_proxy_mock.cpp",
"//base/accessibility/services/test/mock/accessibility_element_operator_callback_stub_mock.cpp",
@ -592,13 +570,9 @@ ohos_moduletest("aams_common_event_registry_test") {
"//base/accessibility/services/test/mock/common_event_manager_mock.cpp",
"//base/accessibility/services/test/mock/common_event_subscribe_info_mock.cpp",
"//base/accessibility/services/test/mock/common_event_subscriber_mock.cpp",
#"//base/accessibility/services/test/mock/mock_system_ability_manager_stub.cpp",
"//base/accessibility/services/test/mock/common_event_support_mock.cpp",
"//base/accessibility/services/test/mock/gesture_simulation_mock.cpp",
"//base/accessibility/services/test/mock/matching_skill_mock.cpp",
#"//base/accessibility/services/test/mock/system_ability_manager.cpp",
"//base/accessibility/services/test/mock/mock_bundle_manager.cpp",
"//base/accessibility/services/test/mock/mock_bundle_mgr_proxy.cpp",
"//base/accessibility/services/test/mock/mock_display.cpp",
@ -609,7 +583,7 @@ ohos_moduletest("aams_common_event_registry_test") {
sources += aams_mock_distributeddatamgr_src
sources += aams_mock_multimodalinput_src
sources += MockPowerManagerSrc
sources += aams_mock_powermanager_src
sources += MockAafwkSrc
sources += MockDistributedscheduleSrc
@ -621,8 +595,6 @@ ohos_moduletest("aams_common_event_registry_test") {
"//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler",
"//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk",
"//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
#"//foundation/distributedschedule/samgr/interfaces/innerkits/common:samgr_common",
"//foundation/multimedia/image_standard/interfaces/innerkits:image_native",
"//foundation/windowmanager/utils:libwmutil",
"//third_party/googletest:gmock_main",
@ -653,13 +625,6 @@ group("moduletest") {
deps = []
if (is_phone_product) {
deps += [
":aams_accessibility_keyevent_filter_test",
":aams_accessibility_touchEvent_injector_test",
":aams_accessibility_touch_guider_test",
":aams_accessible_ability_channel_test",
":aams_common_event_registry_test",
":aams_server_test",
]
deps += []
}
}

View File

@ -16,10 +16,12 @@ AAMS_MOCK_PATH = "//base/accessibility/services/test/mock"
aams_mock_include_dirs = [
"$AAMS_MOCK_PATH/distributeddatamgr/include",
"$AAMS_MOCK_PATH/multimodalinput/include",
"$AAMS_MOCK_PATH/powermanager/include",
"//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_preferences/include",
"//foundation/multimodalinput/input/common/include",
"//foundation/multimodalinput/input/interfaces/native/innerkits/proxy/include",
"//foundation/multimodalinput/input/interfaces/native/innerkits/event/include",
"//base/powermgr/power_manager/interfaces/innerkits/native/include",
]
aams_mock_distributeddatamgr_src =
@ -31,3 +33,6 @@ aams_mock_multimodalinput_src = [
"$AAMS_MOCK_PATH/multimodalinput/src/mock_key_event.cpp",
"$AAMS_MOCK_PATH/multimodalinput/src/mock_pointer_event.cpp",
]
aams_mock_powermanager_src =
[ "$AAMS_MOCK_PATH/powermanager/src/mock_power_mgr_client.cpp" ]

View File

@ -40,27 +40,29 @@ Display::~Display()
DisplayId Display::GetId() const
{
return pImpl_->GetDisplayInfo()->GetDisplayId();
DisplayId id {0};
return id;
}
int32_t Display::GetWidth() const
{
return pImpl_->GetDisplayInfo()->GetWidth();
return 0;
}
int32_t Display::GetHeight() const
{
return pImpl_->GetDisplayInfo()->GetHeight();
return 0;
}
uint32_t Display::GetRefreshRate() const
{
return pImpl_->GetDisplayInfo()->GetRefreshRate();
return 0;
}
ScreenId Display::GetScreenId() const
{
return pImpl_->GetDisplayInfo()->GetScreenId();
ScreenId id {0};
return id;
}
void Display::UpdateDisplayInfo(sptr<DisplayInfo> displayInfo) const

View File

@ -62,7 +62,8 @@ DisplayId DisplayManager::GetDefaultDisplayId()
sptr<Display> DisplayManager::GetDisplayById(DisplayId displayId)
{
return nullptr;
sptr<Display> display = new Display("display_mock", nullptr);
return display;
}
std::shared_ptr<Media::PixelMap> DisplayManager::GetScreenshot(DisplayId displayId)

View File

@ -13,21 +13,13 @@
* limitations under the License.
*/
#ifndef POWERMGR_POWER_MGR_CLIENT_H
#define POWERMGR_POWER_MGR_CLIENT_H
#ifndef MOCK_POWERMGR_POWER_MGR_CLIENT_H
#define MOCK_POWERMGR_POWER_MGR_CLIENT_H
#include <string>
#include <singleton.h>
#include "power_state_machine_info.h"
#include "power_mgr_client.h"
namespace OHOS {
namespace PowerMgr {
class PowerMgrClient final : public DelayedRefSingleton<PowerMgrClient> {
DECLARE_DELAYED_REF_SINGLETON(PowerMgrClient)
public:
void RefreshActivity(UserActivityType type = UserActivityType::USER_ACTIVITY_TYPE_OTHER);
};
} // namespace PowerMgr
} // namespace OHOS
#endif // POWERMGR_POWER_MGR_CLIENT_H

View File

@ -1,148 +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 POWERMGR_POWER_STATE_MACHINE_INFO_H
#define POWERMGR_POWER_STATE_MACHINE_INFO_H
#include <string>
#include <parcel.h>
namespace OHOS {
namespace PowerMgr {
/*
* If already dimmed, extend the dim timeout but do not brighten. This flag is useful for keeping
* the screen on little longer without causing a visible change such as when the power key is pressed.
*/
constexpr uint32_t REFRESH_ACTIVITY_NO_CHANGE_LIGHTS = 1 << 0;
constexpr uint32_t REFRESH_ACTIVITY_NEED_CHANGE_LIGHTS = 0;
/*
* Indicate whether device enter suspend immediately
*/
constexpr uint32_t SUSPEND_DEVICE_IMMEDIATELY = 1 << 0;
// This is use for judge whether the time is valid.
constexpr int DEFAULT_SYSTEM_START_TIME = 0;
// Max datails string length
constexpr int MAX_STRING_LENGTH = 128;
// Throttling interval for user activity calls.
constexpr int64_t MIN_TIME_MS_BETWEEN_USERACTIVITIES = 100; // 100ms
/**
* PowerState of Device.
*/
enum class PowerState : uint32_t {
/**
* Power State: screen on and cpu on.
*/
AWAKE = 0,
/**
* Power State: screen off and cpu on.
*/
INACTIVE,
/**
* Power State: screen off and cpu off.
*/
SLEEP,
/**
* Power State: unknown.
*/
UNKNOWN,
};
/**
* Display State of Device.
*/
enum class DisplayState : uint32_t {
DISPLAY_OFF = 0,
DISPLAY_DIM = 1,
DISPLAY_ON = 2,
DISPLAY_SUSPEND = 3,
};
// UserActivityType list, must sync with A_PMS
enum class UserActivityType : uint32_t {
USER_ACTIVITY_TYPE_OTHER = 0,
USER_ACTIVITY_TYPE_BUTTON = 1,
USER_ACTIVITY_TYPE_TOUCH = 2,
USER_ACTIVITY_TYPE_ACCESSIBILITY = 3,
USER_ACTIVITY_TYPE_ATTENTION = 4,
USER_ACTIVITY_TYPE_SOFTWARE = 5,
USER_ACTIVITY_TYPE_MAX = USER_ACTIVITY_TYPE_SOFTWARE,
};
// WakeupReasonType list
enum class WakeupDeviceType : uint32_t {
WAKEUP_DEVICE_UNKNOWN = 0,
WAKEUP_DEVICE_POWER_BUTTON = 1,
WAKEUP_DEVICE_APPLICATION = 2,
WAKEUP_DEVICE_PLUGGED_IN = 3,
WAKEUP_DEVICE_GESTURE = 4,
WAKEUP_DEVICE_CAMERA_LAUNCH = 5,
WAKEUP_DEVICE_WAKE_KEY = 6,
WAKEUP_DEVICE_WAKE_MOTION = 7,
WAKEUP_DEVICE_HDMI = 8,
WAKEUP_DEVICE_LID = 9,
WAKEUP_DEVICE_DOUBLE_CLICK = 10,
WAKEUP_DEVICE_KEYBOARD = 11,
WAKEUP_DEVICE_MOUSE = 12,
WAKEUP_DEVICE_MAX = WAKEUP_DEVICE_MOUSE,
};
// SuspendDeviceType list
enum class SuspendDeviceType : uint32_t {
SUSPEND_DEVICE_REASON_MIN = 0,
SUSPEND_DEVICE_REASON_APPLICATION = SUSPEND_DEVICE_REASON_MIN,
SUSPEND_DEVICE_REASON_DEVICE_ADMIN = 1,
SUSPEND_DEVICE_REASON_TIMEOUT = 2,
SUSPEND_DEVICE_REASON_LID_SWITCH = 3,
SUSPEND_DEVICE_REASON_POWER_BUTTON = 4,
SUSPEND_DEVICE_REASON_HDMI = 5,
SUSPEND_DEVICE_REASON_SLEEP_BUTTON = 6,
SUSPEND_DEVICE_REASON_ACCESSIBILITY = 7,
SUSPEND_DEVICE_REASON_FORCE_SUSPEND = 8,
SUSPEND_DEVICE_REASON_MAX = SUSPEND_DEVICE_REASON_FORCE_SUSPEND,
};
enum class StateChangeReason : uint32_t {
STATE_CHANGE_REASON_INIT = 0,
STATE_CHANGE_REASON_TIMEOUT = 1,
STATE_CHANGE_REASON_RUNNING_LOCK = 2,
STATE_CHANGE_REASON_BATTERY = 3,
STATE_CHANGE_REASON_THERMAL = 4,
STATE_CHANGE_REASON_WORK = 5,
STATE_CHANGE_REASON_SYSTEM = 6,
STATE_CHANGE_REASON_APPLICATION = 10,
STATE_CHANGE_REASON_SETTINGS = 11,
STATE_CHANGE_REASON_HARD_KEY = 12,
STATE_CHANGE_REASON_TOUCH = 13,
STATE_CHANGE_REASON_CABLE = 14,
STATE_CHANGE_REASON_SENSOR = 15,
STATE_CHANGE_REASON_LID = 16,
STATE_CHANGE_REASON_CAMERA = 17,
STATE_CHANGE_REASON_ACCESSIBILITY = 18,
STATE_CHANGE_REASON_RESET = 19,
STATE_CHANGE_REASON_REMOTE = 100,
STATE_CHANGE_REASON_UNKNOWN = 1000,
};
} // namespace PowerMgr
} // namespace OHOS
#endif // POWERMGR_POWER_STATE_MACHINE_INFO_H

View File

@ -13,17 +13,112 @@
* limitations under the License.
*/
#include "power_mgr_client.h"
#include "mock_power_mgr_client.h"
namespace OHOS {
namespace PowerMgr {
PowerMgrClient::PowerMgrClient()
{}
PowerMgrClient::~PowerMgrClient()
{}
PowerMgrClient::PowerMgrClient() {}
PowerMgrClient::~PowerMgrClient() {}
ErrCode PowerMgrClient::Connect()
{
return ERR_OK;
}
void PowerMgrClient::ResetProxy(const wptr<IRemoteObject>& remote)
{
}
void PowerMgrClient::PowerMgrDeathRecipient::OnRemoteDied(const wptr<IRemoteObject>& remote)
{
}
void PowerMgrClient::RebootDevice(const std::string& reason)
{
}
void PowerMgrClient::ShutDownDevice(const std::string& reason)
{
}
void PowerMgrClient::SuspendDevice(SuspendDeviceType reason, bool suspendImmed)
{
}
void PowerMgrClient::WakeupDevice(WakeupDeviceType reason, const std::string& detail)
{
}
void PowerMgrClient::RefreshActivity(UserActivityType type)
{
}
bool PowerMgrClient::IsRunningLockTypeSupported(uint32_t type)
{
return true;
}
bool PowerMgrClient::ForceSuspendDevice()
{
return true;
}
bool PowerMgrClient::IsScreenOn()
{
return true;
}
PowerState PowerMgrClient::GetState()
{
return PowerState::UNKNOWN;
}
std::shared_ptr<RunningLock> PowerMgrClient::CreateRunningLock(const std::string& name, RunningLockType type)
{
return nullptr;
}
void PowerMgrClient::RegisterPowerStateCallback(const sptr<IPowerStateCallback>& callback)
{
}
void PowerMgrClient::UnRegisterPowerStateCallback(const sptr<IPowerStateCallback>& callback)
{
}
void PowerMgrClient::RegisterShutdownCallback(const sptr<IShutdownCallback>& callback,
IShutdownCallback::ShutdownPriority priority)
{
}
void PowerMgrClient::UnRegisterShutdownCallback(const sptr<IShutdownCallback>& callback)
{
}
void PowerMgrClient::RegisterPowerModeCallback(const sptr<IPowerModeCallback>& callback)
{
}
void PowerMgrClient::UnRegisterPowerModeCallback(const sptr<IPowerModeCallback>& callback)
{
}
void PowerMgrClient::SetDisplaySuspend(bool enable)
{
}
void PowerMgrClient::SetDeviceMode(const uint32_t mode)
{
}
uint32_t PowerMgrClient::GetDeviceMode()
{
return ERR_OK;
}
std::string PowerMgrClient::Dump(const std::vector<std::string>& args)
{
return "ERR_OK";
}
} // namespace PowerMgr
} // namespace OHOS

View File

@ -80,7 +80,7 @@ void AamsInjectorTest::SetUp()
{
GTEST_LOG_(INFO) << "AamsInjectorTest SetUp";
CreateAccessibilityConfigForTouchGuide();
// 注册bundleservice
// register bundleservice
mock_ = new OHOS::AppExecFwk::BundleMgrService();
sptr<ISystemAbilityManager> systemAbilityManager =
SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();

View File

@ -129,7 +129,7 @@ void AamsTouchGuideTest::SetUp()
{
GTEST_LOG_(INFO) << "AamsTouchGuideTest SetUp";
CreateAccessibilityConfigForTouchGuide();
// 注册bundleservice
// register bundleservice
mock_ = new OHOS::AppExecFwk::BundleMgrService();
sptr<ISystemAbilityManager> systemAbilityManager =
SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();

View File

@ -67,6 +67,7 @@ bool AccessibilityWindowInfo::Marshalling(Parcel &parcel) const
AccessibilityWindowInfo* AccessibilityWindowInfo::Unmarshalling(Parcel& parcel)
{
(void)parcel;
AccessibilityWindowInfo *accessibilityWindow = new AccessibilityWindowInfo();
return accessibilityWindow;
}
@ -202,6 +203,7 @@ int AccessibilityWindowInfo::GetChildNum() const
AccessibilityWindowInfo AccessibilityWindowInfo::GetChild(const int index)
{
(void)index;
AccessibilityWindowInfo win {};
return win;
}

View File

@ -89,14 +89,12 @@ void AccessibilityCommonEventRegistryTest::TearDown()
void AccessibilityCommonEventRegistryTest::AddAccessibleAbilityConnection()
{
GTEST_LOG_(INFO) << "AccessibilityCommonEventRegistryTest AddAccessibleAbilityConnection";
// accessibleAbility connection
AppExecFwk::ExtensionAbilityInfo info;
AAFwk::Want want;
AppExecFwk::ElementName name;
name.SetAbilityName("com.example.aalisttest.MainAbility");
name.SetBundleName("com.example.aalisttest");
want.SetElement(name);
sptr<AccessibilityAbilityInfo> abilityInfo = new AccessibilityAbilityInfo(info);
accountData_ = aams_->GetCurrentAccountData();
AAConnection_ = new AccessibleAbilityConnection(accountData_, 0, *abilityInfo);

View File

@ -183,7 +183,7 @@ void AAMSServerTest::AddAccessibleAbilityConnection()
/**
* @tc.number: AAMS_moduletest_SendEvent_001
* @tc.name: SendEvent
* @tc.desc: Test function SendEvent aams send a event to accessibility,and check the parm of event.
* @tc.desc: Test function SendEvent aams send event to accessibility,and check the parm of event.
*
*/
HWTEST_F(AAMSServerTest, SendEvent_001, TestSize.Level1)
@ -191,7 +191,7 @@ HWTEST_F(AAMSServerTest, SendEvent_001, TestSize.Level1)
GTEST_LOG_(INFO) << "AAMSServerTest SendEvent_001 start";
// register AA
AddAccessibleAbilityConnection();
// make a event
// make an event
AccessibilityEventInfo eventInfo;
eventInfo.SetEventType(EventType::TYPE_WINDOW_UPDATE);
// aams send event

View File

@ -35,7 +35,7 @@ void AccessibleAbilityListenerTest::OnAccessibilityEvent(const AccessibilityEven
void AccessibleAbilityListenerTest::OnGesture(uint32_t gestureId)
{
HILOG_INFO("AamsStAbilityA1: A gesture is received and gestureId is %{public}d.", gestureId);
HILOG_INFO("AamsStAbilityA1: A gesture is received and gestureId is %{public}u.", gestureId);
}
void AccessibleAbilityListenerTest::OnInterrupt()

View File

@ -40,10 +40,8 @@ void AccessibleAbilityListenerTest::OnAccessibilityEvent(const AccessibilityEven
{
HILOG_INFO("##############AamsStAbilityB1: An Accessibility event is received and eventType is %{public}d",
eventInfo.GetEventType());
std::optional<AccessibilityElementInfo> elementInfo;
Accessibility::AccessibleAbility::GetInstance().GetRootElementInfo(elementInfo);
if (elementInfo.has_value()) {
HILOG_INFO("elementInfo has value.");
} else {