如何分析是那个应用导致状态栏消失

来源:互联网 发布:淘宝饰品店店铺介绍 编辑:程序博客网 时间:2024/05/16 02:03
如何分析是那个应用导致状态栏消失
状态栏主要的几个控制类中需要增加log如下,再根据pid去查是那个进程.
StatusBarManager.java
  1. public void disable(int what) {
  2. try {
  3. final IStatusBarService svc = getService();
  4. if (svc != null) {
  5. if ( (what & DISABLE_EXPAND) != 0 ) {
  6. Slog.d("StatusBarManager", "disable status bar , call from" , new RuntimeException("disable"));
  7. }
  8. svc.disable(what, mToken, mContext.getPackageName());
  9. }
  10. } catch (RemoteException ex) {
  11. // system process is dead anyway.
  12. throw new RuntimeException(ex);
  13. }
  14. }

StatusBarManagerService.java
  1. private void disableLocked(int userId, int what, IBinder token, String pkg) {
  2. // It's important that the the callback and the call to mBar get done
  3. // in the same order when multiple threads are calling this function
  4. // so they are paired correctly. The messages on the handler will be
  5. // handled in the order they were enqueued, but will be outside the lock.
  6. manageDisableListLocked(userId, what, token, pkg);
  7. // Ensure state for the current user is applied, even if passed a non-current user.
  8. final int net = gatherDisableActionsLocked(mCurrentUserId);
  9. if (net != mDisabled) {
  10. mDisabled = net;
  11. mHandler.post(new Runnable() {
  12. public void run() {
  13. mNotificationDelegate.onSetDisabled(net);
  14. }
  15. });
  16. if (mBar != null) {
  17. try {
  18. /// M:[ALPS01673960] Fix User cannot drag down the notification bar.
  19. Slog.d(TAG, "disable statusbar calling PID = " + Binder.getCallingPid());
  20. mBar.disable(net);
  21. } catch (RemoteException ex) {
  22. }
  23. }
  24. }
  25. }

0 0
原创粉丝点击