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

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

Change-Id: I68844967fbef3cffb7211ce72fd502ae19c331c8