[GraphicsEnvironment] Avoid null access.

Currently when debug layer apk is not installed, GraphicsEnvironment
logs the message and proceeds, which results in null pointer access
crash when later trying to access primaryAbi. Avoid null access by an
early return statement.

Bug: b/175699044
Test: specify not installed debug layer apk and no crash
Change-Id: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
Merged-In: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
(cherry picked from commit c5c17e66ba)
This commit is contained in:
Peiyong Lin
2020-09-28 23:17:37 -07:00
parent 11ed014edf
commit d22eebefdb

View File

@@ -248,6 +248,7 @@ public class GraphicsEnvironment {
}
if (appInfo == null) {
Log.w(TAG, "Debug layer app '" + packageName + "' not installed");
return "";
}
final String abi = chooseAbi(appInfo);