Skip to content
Commit 099faf74 authored by Joanne Chung's avatar Joanne Chung
Browse files

Fix broken tests in TextClassifierServiceTest.

We introduce SystemTCMetadata in ag/10605740 which centrializes the
needed information for the TCMS to process the requests. Because we
change the getPackageName() logic to return the calling package name
of SystemTCMetadata and the SystemTCMetadata is only created if the
event is from the SystemTC not other TCs. The tests fail because the
SelectionEvent.packageName is not populated.

This cl contains the following changes:
- Return the package name that the SelectionEvent or
TextClassificationContext originated from
- Fix incorrect javadoc of TextClassificationContext.getPackageName
- Always verify the calling package name for onSelectionEvent and
onTextClassifierEvent

Bug: 151614815
Test: atest TextClassifierServiceTest
Test: atest FrameworksCoreTests:android.view.textclassifier
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
Test: atest CtsTextClassifierTestCases
Change-Id: Iabe1691d63e3ec6ac834984cf79b60faf9c0e765
parent 1660402a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment