Skip to content

Commit b451065

Browse files
sjuddglide-copybara-robot
authored andcommittedNov 17, 2020
Reset frame state after UI_HIDDEN and minor cleanup.
PiperOrigin-RevId: 342767032
1 parent 410ab7e commit b451065

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
 

‎library/src/main/java/com/bumptech/glide/load/resource/bitmap/HardwareConfigState.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,17 @@ public static HardwareConfigState getInstance() {
126126
}
127127
}
128128

129-
public synchronized void blockHardwareBitmaps() {
129+
public boolean areHardwareBitmapsBlocked() {
130+
Util.assertMainThread();
131+
return !isHardwareConfigAllowedByAppState.get();
132+
}
133+
134+
public void blockHardwareBitmaps() {
130135
Util.assertMainThread();
131136
isHardwareConfigAllowedByAppState.set(false);
132137
}
133138

134-
public synchronized void unblockHardwareBitmaps() {
139+
public void unblockHardwareBitmaps() {
135140
Util.assertMainThread();
136141
isHardwareConfigAllowedByAppState.set(true);
137142
}

‎library/src/main/java/com/bumptech/glide/manager/FirstFrameAndAfterTrimMemoryWaiter.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ public void onTrimMemory(int level) {}
2020
public void onConfigurationChanged(@NonNull Configuration newConfig) {}
2121

2222
@Override
23-
public void onLowMemory() {}
23+
public void onLowMemory() {
24+
onTrimMemory(TRIM_MEMORY_UI_HIDDEN);
25+
}
2426
}

0 commit comments

Comments
 (0)
Please sign in to comment.