Skip to content

Commit

Permalink
Aware: Log Memory Trim Events in UX Session
Browse files Browse the repository at this point in the history
Differential Revision: D63832978

fbshipit-source-id: 454e2e9808e956f3a3c69e8e9dc44a3321fca51d
  • Loading branch information
Oleg Kot authored and facebook-github-bot committed Oct 3, 2024
1 parent 2582448 commit 687adb0
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,14 @@ private MemoryTrimType(double suggestedTrimRatio) {
public double getSuggestedTrimRatio() {
return mSuggestedTrimRatio;
}

/** Map an integer to a MemoryTrimType enum. */
public static MemoryTrimType fromInt(int type) {
for (MemoryTrimType trimType : MemoryTrimType.values()) {
if (trimType.ordinal() == type) {
return trimType;
}
}
throw new IllegalArgumentException("Unknown type: " + type);
}
}

0 comments on commit 687adb0

Please sign in to comment.