Merge "Assign the bit calculation as long to prevent overflow" am: d125112aa2 am: 7f5c1bc46c

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

Change-Id: I68844967fbef3cffb7211ce72fd502ae19c331c8