Merge "Add null check for component name when fetching uid" into qt-dev

am: 35d6deced8

Change-Id: I458be4b7028f81d955bde72c75e64a98293f02b8
This commit is contained in:
Winson Chung
2019-05-24 17:53:05 -07:00
committed by android-build-merger

View File

@@ -72,6 +72,9 @@ public class MetricsLoggerWrapper {
*/
private static int getUid(Context context, ComponentName componentName, int userId) {
int uid = -1;
if (componentName == null) {
return uid;
}
try {
uid = context.getPackageManager().getApplicationInfoAsUser(
componentName.getPackageName(), 0, userId).uid;