You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hmz007 36ed224bac
Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
1 year ago
..
src/android/trust Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
Android.bp Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
AndroidManifest.xml Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
AndroidTest.xml Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
OWNERS Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
README.md Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago
TEST_MAPPING Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a) 1 year ago

README.md

TrustTests framework tests

These tests test the "trust" part of the platform primarily implemented via TrustManagerService in the system server and TrustAgentService in system apps.

Tests are separated into separate files based on major groupings. When creating new tests, find a closely matching existing test file or create a new test file. Prefer many test files over large test files.

Each test file has its own trust agent. To create a new trust agent:

  1. Create a new class extending from BaseTrustAgentService class in your test file
  2. Add a new <service> stanza to AndroidManifest.xml in this directory for the new agent following the pattern fo the existing agents.

To run:

atest TrustTests

Testing approach:

  1. Test the agent service as a black box; avoid inspecting internal state of the service or modifying the system code outside of this directory.
  2. The primary interface to the system is through these three points:
    1. TrustAgentService, your agent created by the TrustAgentRule and accessible via the agent property of the rule.
      1. Call command methods (e.g. grantTrust) directly on the agent
      2. Listen to events (e.g. onUserRequestedUnlock) by implementing the method in your test's agent class and tracking invocations. See UserUnlockRequestTest for an example.
    2. TrustManager which is the interface the rest of the system (e.g. SystemUI) has to the service.
      1. Through this API, simulate system events that the service cares about (e.g. reportUnlockAttempt).
    3. TrustListener which is the interface the rest of the system (e.g. SystemUI) uses to receive events from the service.
      1. Through this, verify behavior that affects the rest of the system. For example, see LockStateTrackingRule.
  3. To re-use code between tests, prefer creating new rules alongside the existing rules or adding functionality to a closely matching existing rule.