summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorHai Zhang <zhanghai@google.com>2019-04-26 15:01:59 +0800
committerHai Zhang <zhanghai@google.com>2019-04-26 15:09:10 +0800
commit91858b0aac9f6a4f247f12f7eb856eec5f6cdec2 (patch)
tree8fd88eb0377a657c23f798490b43a1e6680291fa /tools/aapt2/java/JavaClassGenerator_test.cpp
parent471ddb2bd991029096b707d481b008a7d78c4cb6 (diff)
Use ActivityThread.currentApplication() for application context.
Context.getApplicationContext() might return null if the context is created with Context.createPackageContextAsUser(), as the application instance for that context won't be created. In this case we can use ActivityThread.currentApplication() directly, which does the same thing as if the context wasn't created for a specific package or user. We are only using this application context to bind to other services so it will work fine. Bug: 131356152 Test: presubmit Change-Id: Iee1ac9aa088d452dc58dd7f19edc58a3e0b791a6
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions