mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-04 15:35:38 +01:00
Fix bad flag parsing on attachment pointers.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package org.whispersystems.util;
|
||||
|
||||
public final class FlagUtil {
|
||||
|
||||
private FlagUtil() {}
|
||||
|
||||
/**
|
||||
* Left shift 1 by 'flag' - 1 spaces.
|
||||
*
|
||||
* Examples:
|
||||
* 1 -> 0001
|
||||
* 2 -> 0010
|
||||
* 3 -> 0100
|
||||
* 4 -> 1000
|
||||
*/
|
||||
public static int toBinaryFlag(int flag) {
|
||||
return 1 << (flag - 1);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user