Skip to content
Commit 91858b0a authored by Hai Zhang's avatar Hai Zhang
Browse files

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
parent 471ddb2b
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