summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator.cpp
diff options
context:
space:
mode:
authorPatrick Baumann <patb@google.com>2020-07-23 14:15:29 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-07-26 20:55:43 +0000
commit1adf9e656032f1850a7a1d5731cc67469bc26fc9 (patch)
tree7b19302525387e9f847cf572bf40ffd34830ec0a /tools/aapt2/java/JavaClassGenerator.cpp
parentfd90ff85ebcca46186e14d668a8ea2fa03777338 (diff)
Fix unintended preferred activity reset
When the preferred handler of an action is saved with "always", the set of components displayed as options to the user are saved with it. On subsequent queries, if that set of components change, the preference is cleared to allow the user to consider the new set. With the introduction of app visibility filtering in R (and to a lesser extent, Instant Apps in O), the set of apps that an app can see may be less than the set that the system can. As a result, if the caller calls resolveIntent and cannot see all of the apps the system can, it may reset the user preference unexpectedly. This change ensures that before we clear the user preference that we're comparing against the full set of apps. As such, if we encounter a call to the method from an app that cannot see all apps, we avoid any mutations and instead just return the set of apps that the user can see or the preferred app if it's part of the set they can see. If the system calls or if the call is part of an activity start, we'll allow reset of the preference. Test: Manual - Install 3 cameras, verify preference only reset on start Fixes: 157548344 Change-Id: Icb50a66500edba26c4c6c3e80a6a9c544d4d63d6 (cherry picked from commit 312755820a8d5ec76d4d0c26a36a9c354591e248)
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions