why disgust with reflection?
Because it is not part of the Android SDK. Only people interested in creating untrustworthy applications will try to interact with the StatusBarManager outside the Android source code, as the main Android developers and devices can change anything outside the SDK whenever they want.
Why can't I find a reference to the StatusBarManager class directly?
Because it is not part of the Android SDK. There are many classes and methods in Android framework classes that are marked with the @hide annotation for various reasons: reluctance to fix API support for an indefinite period, "safety from obscurity", etc.
Why is there no constant in the Context class for the statusbar service?
Because it is not part of the Android SDK. Of course, you can provide corrections for AOSP so that the StatusBarManager “advanced” to the same status as other system services (for example, LocationManager , NotificationManager ). If the StatusBarManager situation is just an oversight after the SDK was created in ~ 2007, your patches can be accepted and you will see a change in the upcoming version of Android.
source share