Skip to content

Commit fc5cde4

Browse files
authored
Fix lint erors (#5188)
Signed-off-by: utzcoz <[email protected]>
1 parent 183167c commit fc5cde4

File tree

4 files changed

+227
-0
lines changed

4 files changed

+227
-0
lines changed

firebase-inappmessaging-display/firebase-inappmessaging-display.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ android {
4242
disable "GradleCompatible"
4343
}
4444

45+
lint {
46+
baseline = file("lint-baseline.xml")
47+
}
48+
4549
compileOptions {
4650
sourceCompatibility JavaVersion.VERSION_1_8
4751
targetCompatibility JavaVersion.VERSION_1_8
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<issues format="6" by="lint 7.4.2" type="baseline" client="gradle" dependencies="false" name="AGP (7.4.2)" variant="all" version="7.4.2">
3+
4+
<issue
5+
id="CheckResult"
6+
message="The result of `placeholder` is not used"
7+
errorLine1=" requestBuilder.placeholder(placeholderResId);"
8+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
9+
<location
10+
file="src/main/java/com/google/firebase/inappmessaging/display/internal/FiamImageLoader.java"
11+
line="95"
12+
column="7"/>
13+
</issue>
14+
15+
<issue
16+
id="WrongConstant"
17+
message="Must be one or more of: Gravity.FILL, Gravity.FILL_HORIZONTAL, Gravity.FILL_VERTICAL, Gravity.START, Gravity.END, Gravity.LEFT, Gravity.RIGHT, Gravity.TOP, Gravity.BOTTOM, Gravity.CENTER, Gravity.CENTER_HORIZONTAL, Gravity.CENTER_VERTICAL, Gravity.DISPLAY_CLIP_HORIZONTAL, Gravity.DISPLAY_CLIP_VERTICAL, Gravity.CLIP_HORIZONTAL, Gravity.CLIP_VERTICAL, Gravity.NO_GRAVITY"
18+
errorLine1=" layoutParams.gravity = layoutConfig.viewWindowGravity();"
19+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
20+
<location
21+
file="src/main/java/com/google/firebase/inappmessaging/display/internal/FiamWindowManager.java"
22+
line="120"
23+
column="28"/>
24+
</issue>
25+
26+
<issue
27+
id="InflateParams"
28+
message="Avoid passing `null` as the view root (needed to resolve layout parameters on the inflated layout&apos;s root element)"
29+
errorLine1=" View root = inflater.inflate(R.layout.banner, null);"
30+
errorLine2=" ~~~~">
31+
<location
32+
file="src/main/java/com/google/firebase/inappmessaging/display/internal/bindingwrappers/BannerBindingWrapper.java"
33+
line="67"
34+
column="51"/>
35+
</issue>
36+
37+
<issue
38+
id="InflateParams"
39+
message="Avoid passing `null` as the view root (needed to resolve layout parameters on the inflated layout&apos;s root element)"
40+
errorLine1=" View root = inflater.inflate(R.layout.card, null);"
41+
errorLine2=" ~~~~">
42+
<location
43+
file="src/main/java/com/google/firebase/inappmessaging/display/internal/bindingwrappers/CardBindingWrapper.java"
44+
line="72"
45+
column="49"/>
46+
</issue>
47+
48+
<issue
49+
id="InflateParams"
50+
message="Avoid passing `null` as the view root (needed to resolve layout parameters on the inflated layout&apos;s root element)"
51+
errorLine1=" View v = inflater.inflate(R.layout.image, null);"
52+
errorLine2=" ~~~~">
53+
<location
54+
file="src/main/java/com/google/firebase/inappmessaging/display/internal/bindingwrappers/ImageBindingWrapper.java"
55+
line="65"
56+
column="47"/>
57+
</issue>
58+
59+
<issue
60+
id="InflateParams"
61+
message="Avoid passing `null` as the view root (needed to resolve layout parameters on the inflated layout&apos;s root element)"
62+
errorLine1=" View root = inflater.inflate(R.layout.modal, null);"
63+
errorLine2=" ~~~~">
64+
<location
65+
file="src/main/java/com/google/firebase/inappmessaging/display/internal/bindingwrappers/ModalBindingWrapper.java"
66+
line="72"
67+
column="50"/>
68+
</issue>
69+
70+
<issue
71+
id="DisableBaselineAlignment"
72+
message="Set `android:baselineAligned=&quot;false&quot;` on this element for better performance"
73+
errorLine1=" &lt;LinearLayout"
74+
errorLine2=" ~~~~~~~~~~~~">
75+
<location
76+
file="src/main/res/layout/banner.xml"
77+
line="12"
78+
column="6"/>
79+
</issue>
80+
81+
<issue
82+
id="UnusedResources"
83+
message="The resource `R.drawable.placeholder_50_50` appears to be unused">
84+
<location
85+
file="src/debug/res/drawable-mdpi/placeholder_50_50.png"/>
86+
</issue>
87+
88+
<issue
89+
id="UnusedResources"
90+
message="The resource `R.string.card_content_descriptor` appears to be unused"
91+
errorLine1=" &lt;string name=&quot;card_content_descriptor&quot;>card&lt;/string>"
92+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
93+
<location
94+
file="src/main/res/values/strings.xml"
95+
line="3"
96+
column="11"/>
97+
</issue>
98+
99+
<issue
100+
id="ContentDescription"
101+
message="Missing `contentDescription` attribute on image"
102+
errorLine1=" &lt;ImageView"
103+
errorLine2=" ~~~~~~~~~">
104+
<location
105+
file="src/main/res/layout-land/card_landscape_inner.xml"
106+
line="16"
107+
column="6"/>
108+
</issue>
109+
110+
<issue
111+
id="ContentDescription"
112+
message="Missing `contentDescription` attribute on image"
113+
errorLine1=" &lt;ImageView"
114+
errorLine2=" ~~~~~~~~~">
115+
<location
116+
file="src/main/res/layout/card_portrait_inner.xml"
117+
line="14"
118+
column="6"/>
119+
</issue>
120+
121+
<issue
122+
id="RtlEnabled"
123+
message="The project references RTL attributes, but does not explicitly enable or disable RTL support with `android:supportsRtl` in the manifest">
124+
<location
125+
file="src/main/AndroidManifest.xml"/>
126+
</issue>
127+
128+
<issue
129+
id="IgnoreWithoutReason"
130+
message="Test is ignored without giving any explanation"
131+
errorLine1=" @Ignore"
132+
errorLine2=" ~~~~~~~">
133+
<location
134+
file="src/test/java/com/google/firebase/inappmessaging/display/FirebaseInAppMessagingDisplayTest.java"
135+
line="366"
136+
column="3"/>
137+
</issue>
138+
139+
</issues>

firebase-ml-modeldownloader/firebase-ml-modeldownloader.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ android {
5959
includeAndroidResources = true
6060
}
6161
}
62+
lint {
63+
baseline = file("lint-baseline.xml")
64+
}
6265
}
6366

6467
thirdPartyLicenses {
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<issues format="6" by="lint 7.3.1" type="baseline" client="gradle" dependencies="false" name="AGP (7.3.1)" variant="all" version="7.3.1">
3+
4+
<issue
5+
id="ApplySharedPref"
6+
message="Consider using `apply()` instead; `commit` writes its data to persistent storage immediately, whereas `apply` will handle it in the background"
7+
errorLine1=" .commit();"
8+
errorLine2=" ~~~~~~~~">
9+
<location
10+
file="src/main/java/com/google/firebase/ml/modeldownloader/internal/SharedPreferencesUtil.java"
11+
line="164"
12+
column="10"/>
13+
</issue>
14+
15+
<issue
16+
id="ApplySharedPref"
17+
message="Consider using `apply()` instead; `commit` writes its data to persistent storage immediately, whereas `apply` will handle it in the background"
18+
errorLine1=" .commit();"
19+
errorLine2=" ~~~~~~~~">
20+
<location
21+
file="src/main/java/com/google/firebase/ml/modeldownloader/internal/SharedPreferencesUtil.java"
22+
line="192"
23+
column="10"/>
24+
</issue>
25+
26+
<issue
27+
id="ApplySharedPref"
28+
message="Consider using `apply()` instead; `commit` writes its data to persistent storage immediately, whereas `apply` will handle it in the background"
29+
errorLine1=" .commit();"
30+
errorLine2=" ~~~~~~~~">
31+
<location
32+
file="src/main/java/com/google/firebase/ml/modeldownloader/internal/SharedPreferencesUtil.java"
33+
line="226"
34+
column="10"/>
35+
</issue>
36+
37+
<issue
38+
id="ApplySharedPref"
39+
message="Consider using `apply()` instead; `commit` writes its data to persistent storage immediately, whereas `apply` will handle it in the background"
40+
errorLine1=" .commit();"
41+
errorLine2=" ~~~~~~~~">
42+
<location
43+
file="src/main/java/com/google/firebase/ml/modeldownloader/internal/SharedPreferencesUtil.java"
44+
line="317"
45+
column="12"/>
46+
</issue>
47+
48+
<issue
49+
id="ApplySharedPref"
50+
message="Consider using `apply()` instead; `commit` writes its data to persistent storage immediately, whereas `apply` will handle it in the background"
51+
errorLine1=" .commit();"
52+
errorLine2=" ~~~~~~~~">
53+
<location
54+
file="src/main/java/com/google/firebase/ml/modeldownloader/internal/SharedPreferencesUtil.java"
55+
line="324"
56+
column="12"/>
57+
</issue>
58+
59+
<issue
60+
id="Range"
61+
message="Value must be ≥ 0 but `getColumnIndex` can be -1"
62+
errorLine1=" statusCode = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS));"
63+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
64+
<location
65+
file="src/main/java/com/google/firebase/ml/modeldownloader/internal/ModelFileDownloadService.java"
66+
line="318"
67+
column="36"/>
68+
</issue>
69+
70+
<issue
71+
id="Range"
72+
message="Value must be ≥ 0 but `getColumnIndex` can be -1"
73+
errorLine1=" int reason = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_REASON));"
74+
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
75+
<location
76+
file="src/main/java/com/google/firebase/ml/modeldownloader/internal/ModelFileDownloadService.java"
77+
line="476"
78+
column="34"/>
79+
</issue>
80+
81+
</issues>

0 commit comments

Comments
 (0)