Merge "Remove the usage of hidden API and simplify the design" am: 0b66568d6a

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

Change-Id: I8ecf721d9bf465496f32e83ffa272267aba9b309