OSDN Git Service

Introduce a result class for IStatusBarService#registerStatusBar()
authorYohei Yukawa <yukawa@google.com>
Thu, 4 Apr 2019 18:49:02 +0000 (11:49 -0700)
committerYohei Yukawa <yukawa@google.com>
Thu, 4 Apr 2019 18:49:02 +0000 (11:49 -0700)
commit49efa718a86959e1fe996f05669c462c98f836f0
tree6a69e403caebec4486f702ac99cc0d273a0398e6
parentdd07ae579c291a2b6ffe09bd576fd908eb9e5ddd
Introduce a result class for IStatusBarService#registerStatusBar()

This is a preparation to fix an issue that IME cannot enable light
navigation bar on direct-reply.

The initial state of StatusBar client is provided as return values of
IStatusBarService#registerStatusBar().  However, the way for the
client to receive the return values is to rely on "out" parameters in
the Binder method as follows.

    void registerStatusBar(IStatusBar callbacks,
            out List<String> iconSlots,
            out List<StatusBarIcon> iconList,
            out int[] switches,
            out List<IBinder> binders,
            out Rect fullscreenStackBounds,
            out Rect dockedStackBounds);

The issue is that if I want to add a new parameter into
StatusBarManagerService to fix Bug 122439339, then it needs to be
notified back to the client via one of these out values, e.g. a new
element in "switches", which is hard to understand and maintain.

It'd be better to introduce a dedicated return object as follows.

    RegisterStatusBarResult registerStatusBar(IStatusBar callbacks);

This is a purely mechanical code clean-up.  Hence there should be no
behavior change.

Bug: 122439339
Test: presubmit
Change-Id: Ib1c0ae8f591ca09d0bce7a39f85ba57aad386e47
Android.bp
core/java/com/android/internal/statusbar/IStatusBarService.aidl
core/java/com/android/internal/statusbar/RegisterStatusBarResult.aidl [new file with mode: 0644]
core/java/com/android/internal/statusbar/RegisterStatusBarResult.java [new file with mode: 0644]
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
services/core/java/com/android/server/statusbar/StatusBarManagerService.java