Add SafetyNet logging am: 62041d683b

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15220072

Change-Id: I5a821a0c9bd39e0267635ebfb7ce4a2234f14696
This commit is contained in:
Weng Su
2021-08-07 15:02:15 +00:00
committed by Automerger Merge Worker

View File

@@ -28,6 +28,7 @@ import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.net.wifi.WifiManager.ActionListener;
import android.os.Bundle;
import android.util.EventLog;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
@@ -216,6 +217,7 @@ public class WifiDialogActivity extends Activity implements WifiDialog.WifiDialo
final String callingPackage = getCallingPackage();
if (callingPackage == null) {
Log.d(TAG, "Failed to get the calling package, don't return the result.");
EventLog.writeEvent(0x534e4554, "185126813", -1 /* UID */, "no calling package");
return false;
}
@@ -232,6 +234,14 @@ public class WifiDialogActivity extends Activity implements WifiDialog.WifiDialo
}
Log.d(TAG, "The calling package does not have the necessary permissions for result.");
try {
EventLog.writeEvent(0x534e4554, "185126813",
getPackageManager().getPackageUid(callingPackage, 0 /* flags */),
"no permission");
} catch (PackageManager.NameNotFoundException e) {
EventLog.writeEvent(0x534e4554, "185126813", -1 /* UID */, "no permission");
Log.w(TAG, "Cannot find the UID, calling package: " + callingPackage, e);
}
return false;
}
}