Skip to content
Commit 1013d298 authored by Matt Pape's avatar Matt Pape
Browse files

Add DeviceConfig.Properties and return it from change listener.

Add a second method to the OnPropertyChangedListener which returns a
Properties object instead of a single flag. This object will hold only
one flag for now (Q) but easily supports multiple flags at a time when
we are ready to support atomic writes (R). This Properties object also
contains typed getters, so we don't force every single client to
dupliate the parsing and default value logic.

For now, the new method in the change listener has a default
implementation which calls the old method. This ensures that no one's
code is broken (because they aren't implementing the new method) and no
one's feature stops working (the old method is still being called).

This is part 1 of a 4 step migration from the single flag callback to
the new Properties callback.

Part 2 will update the OneTimeDeviceConfigListener in the gts/ repo to
override both the old and new callback methods.

Part 3 will update the DeviceConfig.OnPropertyChangedListener to provide
a default implementation for the old method instead of a default
implementation for the new method. At the same time, all implementations
of DeviceConfig.OnPropertyChangedListener in the core repo will be
updated to implement the new method instead of the old method.

Part 4 will update the OneTimeDeviceConfigListener in the gts/ repo to
override only the new callback method and delete the implementation of
the old callback method.

These 4 parts have to happen in order.

Bug: 126414261
Test: atest FrameworksCoreTests:DeviceConfigTest

Change-Id: If75bce326dcdbc38e22d95982e57ad466cbecdb6
parent efed8e3d
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