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

This commit is contained in:
TreeHugger Robot
2019-05-25 00:05:07 +00:00
committed by Android (Google) Code Review

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;