Upgrade AndroidFrameworkUid to be fatal error.

We've fixed the one remaining example of code that accidentally
crosses UID with userId, so this change upgrades the check to become
a fatal build error to prevent future bugs.

Bug: 155703208
Test: atest error_prone_android_framework_test
Change-Id: I3bc46f8039a88b5f3d5f89dc9b5fda785d5c654f
This commit is contained in:
Jeff Sharkey 2020-10-02 12:00:59 -06:00
parent 6c8ffbca51
commit 9af4aea0c3
3 changed files with 3 additions and 1 deletions

View File

@ -601,6 +601,7 @@ java_library {
errorprone: {
javacflags: [
"-Xep:AndroidFrameworkCompatChange:ERROR",
"-Xep:AndroidFrameworkUid:ERROR",
],
},
}

View File

@ -166,7 +166,7 @@ public final class SelectableTargetInfo implements ChooserTargetInfo {
// Now fetch app icon and raster with no badging even in work profile
Bitmap appIcon = mSelectableTargetInfoCommunicator.makePresentationGetter(info)
.getIconBitmap(UserHandle.getUserHandleForUid(UserHandle.myUserId()));
.getIconBitmap(android.os.Process.myUserHandle());
// Raster target drawable with appIcon as a badge
SimpleIconFactory sif = SimpleIconFactory.obtain(mContext);

View File

@ -6,6 +6,7 @@ java_defaults {
errorprone: {
javacflags: [
"-Xep:AndroidFrameworkCompatChange:ERROR",
"-Xep:AndroidFrameworkUid:ERROR",
],
},
}