Merge "Assign the bit calculation as long to prevent overflow" am: 1122a53585

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1664307

Change-Id: I548347851e102f81cd13516a6a409e74c59859f4