diff options
author | Bernardo Rufino <brufino@google.com> | 2020-04-01 16:46:45 +0100 |
---|---|---|
committer | Bernardo Rufino <brufino@google.com> | 2020-04-03 12:57:08 +0000 |
commit | dd4f23812774226a29b27d01e183f6a24fbed2d3 (patch) | |
tree | f54961b8a7a5bad301e6e4d2edf18ac8e622211a /rs/java/android/renderscript/ProgramFragmentFixedFunction.java | |
parent | f9617e33f94f1459d0b24dba46c443ebcea96542 (diff) |
Refactor ToastPresenter to perform show()/hide()
In order to support multi-user, we need to create a new context based on
the user id and retrieve the services from it
(http://b/151414297#comment9). This meant retrieving the services in
ToastUI.showToast() instead of on its constructor, which would make the
code diverge from Toast$TN.handleShow(). In order to avoid that, now
seemed a good time to refactor ToastPresenter to perform show() and
hide().
This means ToastPresenter will now be instantiated in every request for
a new toast in ToastUI, but fortunately with the refactor we were able
to get rid of ToastEntry (which was also beign instantiated in every
request).
Also found out a bug with this where window tokens were being used to
locate the toasts instead of the (non-window) tokens. This is a bit
confusing because the method NM.finishToken(package, token) receives a
non-window token to locate the ToastRecord and then finish its window
token. This didn't have any side-effects because NM itself finishes the
tokens after a time-out. Added a test for this.
Bug: 152973950
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
ToastWindowTest ToastUITest NotificationManagerServiceTest
LegacyToastTest
Change-Id: I13cf18890ca22022adb7576c8ecf3285a9b82299
Diffstat (limited to 'rs/java/android/renderscript/ProgramFragmentFixedFunction.java')
0 files changed, 0 insertions, 0 deletions