Skip to content

Commit

Permalink
Use Suppress annotation rather than lint baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaunt committed Sep 9, 2024
1 parent 53574df commit ee1b41c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 31 deletions.
10 changes: 5 additions & 5 deletions dev-app/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<issue
id="WrongConstant"
message="Must be one or more of: PackageManager.GET_META_DATA, PackageManager.GET_SHARED_LIBRARY_FILES, PackageManager.MATCH_UNINSTALLED_PACKAGES, PackageManager.MATCH_SYSTEM_ONLY, PackageManager.MATCH_DISABLED_COMPONENTS, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.GET_UNINSTALLED_PACKAGES, PackageManager.MATCH_APEX"
errorLine1=" getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()))"
errorLine2=" ~~~~~~~~~~~~~~">
errorLine1=" getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()))"
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/com/uid2/dev/utils/PackageManagerEx.kt"
line="9"
column="80"/>
file="src/main/java/com/uid2/dev/network/AppUID2Client.kt"
line="202"
column="88"/>
</issue>

</issues>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.os.Build

fun PackageManager.getApplicationInfoCompat(packageName: String, flags: Int = 0): ApplicationInfo =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
@Suppress("WrongConstant")
getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()))
} else {
@Suppress("DEPRECATION")
Expand Down
1 change: 0 additions & 1 deletion securesignals-gma-dev-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ android {
}

lint {
baseline = file("lint-baseline.xml")
disable 'GradleDependency'
}

Expand Down
13 changes: 1 addition & 12 deletions securesignals-gma-dev-app/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.6.0" type="baseline" client="gradle" dependencies="false" name="AGP (8.6.0)" variant="all" version="8.6.0">

<issue
id="WrongConstant"
message="Must be one or more of: PackageManager.GET_META_DATA, PackageManager.GET_SHARED_LIBRARY_FILES, PackageManager.MATCH_UNINSTALLED_PACKAGES, PackageManager.MATCH_SYSTEM_ONLY, PackageManager.MATCH_DISABLED_COMPONENTS, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.GET_UNINSTALLED_PACKAGES, PackageManager.MATCH_APEX"
errorLine1=" getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()))"
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/com/uid2/dev/utils/PackageManagerEx.kt"
line="9"
column="80"/>
</issue>
<issues format="6" by="lint 7.4.2" type="baseline" client="gradle" dependencies="true" name="AGP (7.4.2)" variant="all" version="7.4.2">

</issues>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.os.Build

fun PackageManager.getApplicationInfoCompat(packageName: String, flags: Int = 0): ApplicationInfo =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
@Suppress("WrongConstant")
getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()))
} else {
@Suppress("DEPRECATION")
Expand Down
1 change: 0 additions & 1 deletion securesignals-ima-dev-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ android {
}

lint {
baseline = file("lint-baseline.xml")
disable 'GradleDependency', 'IconDipSize', 'IconDensities', 'RtlEnabled'
}

Expand Down
13 changes: 1 addition & 12 deletions securesignals-ima-dev-app/lint-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.6.0" type="baseline" client="gradle" dependencies="false" name="AGP (8.6.0)" variant="all" version="8.6.0">

<issue
id="WrongConstant"
message="Must be one or more of: PackageManager.GET_META_DATA, PackageManager.GET_SHARED_LIBRARY_FILES, PackageManager.MATCH_UNINSTALLED_PACKAGES, PackageManager.MATCH_SYSTEM_ONLY, PackageManager.MATCH_DISABLED_COMPONENTS, PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS, PackageManager.GET_UNINSTALLED_PACKAGES, PackageManager.MATCH_APEX"
errorLine1=" getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()))"
errorLine2=" ~~~~~~~~~~~~~~">
<location
file="src/main/java/com/uid2/dev/utils/PackageManagerEx.kt"
line="9"
column="80"/>
</issue>
<issues format="6" by="lint 7.4.2" type="baseline" client="gradle" dependencies="true" name="AGP (7.4.2)" variant="all" version="7.4.2">

</issues>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.os.Build

fun PackageManager.getApplicationInfoCompat(packageName: String, flags: Int = 0): ApplicationInfo =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
@Suppress("WrongConstant")
getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(flags.toLong()))
} else {
@Suppress("DEPRECATION")
Expand Down

0 comments on commit ee1b41c

Please sign in to comment.