Use an exception in Android to view the function call stack

Source: Internet
Author: User

In. after the java file DEBUG_SCREEN_ON is opened, the RuntimeException is found in the log. Check the code carefully. The debug information in setLightBrightness was written down specially for future use. 1. setLightBrightness function: private void setLightBrightness (int mask, int value) {int brightnessMode = (mAutoBrightessEnabled? LightsService. BRIGHTNESS_MODE_SENSOR: LightsService. BRIGHTNESS_MODE_USER); if (mask & SCREEN_BRIGHT_BIT )! = 0) {if (DEBUG_SCREEN_ON) {RuntimeException e = new RuntimeException ("here"); e. fillInStackTrace (); Slog. I (TAG, "Set LCD brightness:" + value, e);} mLcdLight. setBrightness (value, brightnessMode);} if (mask & BUTTON_BRIGHT_BIT )! = 0) {mButtonLight. setBrightness (value);} if (mask & KEYBOARD_BRIGHT_BIT )! = 0) {mKeyboardLight. setBrightness (value) ;}} 2. log information: I/PowerManagerService (228): java. lang. runtimeException: hereI/PowerManagerService (228): at com. android. server. powerManagerService. setLightBrightness (PowerManagerService. java: 2160) I/PowerManagerService (228): at com. android. server. powerManagerService. access $4600 (PowerManagerService. java: 77) I/powermanaged erservice (228): at com. android. server. powerManagerService $ BrightnessState. jumpToTargetLocked (PowerManagerService. java: 2265) I/PowerManagerService (228): at com. android. server. powerManagerService. setBacklightBrightness (PowerManagerService. java: 3049) I/PowerManagerService (228): at android. OS. IPowerManager $ Stub. onTransact (IPowerManager. java: 227) I/PowerManagerService (228): at android. OS .Binder.exe cTransact (Binder. java: 338) I/PowerManagerService (228): at dalvik. system. nativeStart. run (Native Method)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.