Skip to content

Commit

Permalink
Reset frame state after UI_HIDDEN and minor cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 342767032
  • Loading branch information
sjudd authored and glide-copybara-robot committed Nov 17, 2020
1 parent 410ab7e commit b451065
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,17 @@ public static HardwareConfigState getInstance() {
}
}

public synchronized void blockHardwareBitmaps() {
public boolean areHardwareBitmapsBlocked() {
Util.assertMainThread();
return !isHardwareConfigAllowedByAppState.get();
}

public void blockHardwareBitmaps() {
Util.assertMainThread();
isHardwareConfigAllowedByAppState.set(false);
}

public synchronized void unblockHardwareBitmaps() {
public void unblockHardwareBitmaps() {
Util.assertMainThread();
isHardwareConfigAllowedByAppState.set(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ public void onTrimMemory(int level) {}
public void onConfigurationChanged(@NonNull Configuration newConfig) {}

@Override
public void onLowMemory() {}
public void onLowMemory() {
onTrimMemory(TRIM_MEMORY_UI_HIDDEN);
}
}

0 comments on commit b451065

Please sign in to comment.