Skip to content
Snippets Groups Projects
Forked from Dhina17 / platform_frameworks_base
Source project has a limited visibility.
  • Jeff Sharkey's avatar
    3e91c2b2
    First pass of "real" services on Ravenwood. · 3e91c2b2
    Jeff Sharkey authored
    One of our eventual goals with Ravenwood is to support usage of
    system services from test code.  Robolectric takes the approach of
    publishing "shadows" which are effectively fakes of the Manager
    objects visible to app processes, and it unfortunately doesn't offer
    a mechanism to run "real" services code.
    
    In contrast, Ravenwood aims to support API owners progressively
    offering their system services either via a "fake" approach, or by
    using various levels of the "real" code that would run on a device.
    
    This change wires up the foundational support and uses the simple
    `SerialManager` example to demonstrate using the same "real" code
    on both Ravenwood and devices.  It also demonstrates the `Internal`
    pattern being used to customize behavior for tests.
    
    To offer as hermetic as a test environment as possible, we start
    new instances of each requested service for each test.  Requiring
    developers to be explicit about the services they need will help
    keep overhead low, especially for tests that don't need services.
    
    Bug: 325506297
    Test: atest RavenwoodServicesTest
    Change-Id: Ie22436b38f2176f91dfce746b899ebab7752bbb8
    3e91c2b2
    History
    First pass of "real" services on Ravenwood.
    Jeff Sharkey authored
    One of our eventual goals with Ravenwood is to support usage of
    system services from test code.  Robolectric takes the approach of
    publishing "shadows" which are effectively fakes of the Manager
    objects visible to app processes, and it unfortunately doesn't offer
    a mechanism to run "real" services code.
    
    In contrast, Ravenwood aims to support API owners progressively
    offering their system services either via a "fake" approach, or by
    using various levels of the "real" code that would run on a device.
    
    This change wires up the foundational support and uses the simple
    `SerialManager` example to demonstrate using the same "real" code
    on both Ravenwood and devices.  It also demonstrates the `Internal`
    pattern being used to customize behavior for tests.
    
    To offer as hermetic as a test environment as possible, we start
    new instances of each requested service for each test.  Requiring
    developers to be explicit about the services they need will help
    keep overhead low, especially for tests that don't need services.
    
    Bug: 325506297
    Test: atest RavenwoodServicesTest
    Change-Id: Ie22436b38f2176f91dfce746b899ebab7752bbb8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.