File tree 1 file changed +40
-3
lines changed
library/src/main/java/com/bumptech/glide/load/resource/bitmap
1 file changed +40
-3
lines changed Original file line number Diff line number Diff line change 8
8
import androidx .annotation .GuardedBy ;
9
9
import androidx .annotation .VisibleForTesting ;
10
10
import java .io .File ;
11
+ import java .util .Arrays ;
11
12
12
13
/**
13
14
* State and constants for interacting with {@link android.graphics.Bitmap.Config#HARDWARE} on
@@ -132,8 +133,44 @@ boolean setHardwareConfigIfAllowed(
132
133
}
133
134
134
135
private static boolean isHardwareConfigAllowedByDeviceModel () {
136
+ return !isHardwareConfigDisallowedByB112551574 () && !isHardwareConfigDisallowedByB147430447 ();
137
+ }
138
+
139
+ private static boolean isHardwareConfigDisallowedByB147430447 () {
140
+ if (Build .VERSION .SDK_INT != Build .VERSION_CODES .O_MR1 ) {
141
+ return false ;
142
+ }
143
+ // This method will only be called once, so simple iteration is reasonable.
144
+ return Arrays .asList (
145
+ "ILA X1" ,
146
+ "LG-M250" ,
147
+ "LG-M320" ,
148
+ "LG-Q710AL" ,
149
+ "LG-Q710PL" ,
150
+ "LGM-K121K" ,
151
+ "LGM-K121L" ,
152
+ "LGM-K121S" ,
153
+ "LGM-X320K" ,
154
+ "LGM-X320L" ,
155
+ "LGM-X320S" ,
156
+ "LGM-X401L" ,
157
+ "LGM-X401S" ,
158
+ "LM-Q610.FG" ,
159
+ "LM-Q610.FGN" ,
160
+ "LM-Q617.FG" ,
161
+ "LM-Q617.FGN" ,
162
+ "LM-Q710.FG" ,
163
+ "LM-Q710.FGN" ,
164
+ "LM-X220PM" ,
165
+ "LM-X220QMA" ,
166
+ "LM-X410PM" ,
167
+ "SGINO" )
168
+ .contains (Build .MODEL );
169
+ }
170
+
171
+ private static boolean isHardwareConfigDisallowedByB112551574 () {
135
172
if (Build .MODEL == null || Build .MODEL .length () < 7 ) {
136
- return true ;
173
+ return false ;
137
174
}
138
175
switch (Build .MODEL .substring (0 , 7 )) {
139
176
case "SM-N935" :
@@ -150,9 +187,9 @@ private static boolean isHardwareConfigAllowedByDeviceModel() {
150
187
// Fall through
151
188
case "SM-A520" :
152
189
// Fall through
153
- return Build .VERSION .SDK_INT ! = Build .VERSION_CODES .O ;
190
+ return Build .VERSION .SDK_INT = = Build .VERSION_CODES .O ;
154
191
default :
155
- return true ;
192
+ return false ;
156
193
}
157
194
}
158
195
You can’t perform that action at this time.
0 commit comments