bigrushdog

PHoneWindowManager.java

Sep 14th, 2011
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 120.71 KB | None | 0 0
  1. package com.android.internal.policy.impl;
  2.  
  3. import android.app.ActivityManagerNative;
  4. import android.app.IActivityManager;
  5. import android.app.UiModeManager;
  6. import android.content.ActivityNotFoundException;
  7. import android.content.BroadcastReceiver;
  8. import android.content.ContentResolver;
  9. import android.content.Context;
  10. import android.content.Intent;
  11. import android.content.IntentFilter;
  12. import android.content.pm.ActivityInfo;
  13. import android.content.pm.PackageManager;
  14. import android.content.res.Configuration;
  15. import android.content.res.Resources;
  16. import android.content.res.Resources.NotFoundException;
  17. import android.database.ContentObserver;
  18. import android.graphics.Rect;
  19. import android.media.AudioManager;
  20. import android.media.IAudioService;
  21. import android.media.IAudioService.Stub;
  22. import android.net.Uri;
  23. import android.os.Bundle;
  24. import android.os.Handler;
  25. import android.os.IBinder;
  26. import android.os.LocalPowerManager;
  27. import android.os.Looper;
  28. import android.os.MessageQueue;
  29. import android.os.PowerManager;
  30. import android.os.PowerManager.WakeLock;
  31. import android.os.RemoteException;
  32. import android.os.ServiceManager;
  33. import android.os.SystemClock;
  34. import android.os.SystemProperties;
  35. import android.os.UEventObserver;
  36. import android.os.Vibrator;
  37. import android.provider.Settings.Secure;
  38. import android.provider.Settings.System;
  39. import android.util.DisplayMetrics;
  40. import android.util.EventLog;
  41. import android.util.Log;
  42. import android.util.Slog;
  43. import android.view.IWindowManager;
  44. import android.view.InputChannel;
  45. import android.view.InputHandler;
  46. import android.view.InputQueue;
  47. import android.view.KeyCharacterMap;
  48. import android.view.KeyCharacterMap.FallbackAction;
  49. import android.view.KeyEvent;
  50. import android.view.View;
  51. import android.view.ViewConfiguration;
  52. import android.view.WindowManager;
  53. import android.view.WindowManager.LayoutParams;
  54. import android.view.WindowManagerPolicy;
  55. import android.view.WindowManagerPolicy.OnKeyguardExitResult;
  56. import android.view.WindowManagerPolicy.WindowState;
  57. import android.view.WindowOrientationListener;
  58. import android.view.animation.Animation;
  59. import android.view.animation.AnimationUtils;
  60. import com.android.internal.statusbar.IStatusBarService;
  61. import com.android.internal.telephony.ITelephony;
  62. import com.android.internal.telephony.ITelephony.Stub;
  63. import com.android.internal.widget.PointerLocationView;
  64. import java.io.File;
  65. import java.io.FileDescriptor;
  66. import java.io.PrintWriter;
  67. import java.util.ArrayList;
  68.  
  69. public class PhoneWindowManager
  70.   implements WindowManagerPolicy
  71. {
  72.   static final int APPLICATION_LAYER = 2;
  73.   static final int APPLICATION_MEDIA_OVERLAY_SUBLAYER = 255;
  74.   static final int APPLICATION_MEDIA_SUBLAYER = 254;
  75.   static final int APPLICATION_PANEL_SUBLAYER = 1;
  76.   static final int APPLICATION_SUB_PANEL_SUBLAYER = 2;
  77.   private static final int BTN_MOUSE = 272;
  78.   static final boolean DEBUG = false;
  79.   static final boolean DEBUG_FALLBACK = false;
  80.   static final boolean DEBUG_LAYOUT = false;
  81.   static final int DEFAULT_ACCELEROMETER_ROTATION = 0;
  82.   static final int DRAG_LAYER = 17;
  83.   static final int INPUT_METHOD_DIALOG_LAYER = 14;
  84.   static final int INPUT_METHOD_LAYER = 13;
  85.   static final int KEYGUARD_DIALOG_LAYER = 16;
  86.   static final int KEYGUARD_LAYER = 15;
  87.   private static final int LID_ABSENT = 255;
  88.   private static final int LID_CLOSED = 0;
  89.   private static final int LID_OPEN = 1;
  90.   static final int LONG_PRESS_HOME_NOTHING = 0;
  91.   static final int LONG_PRESS_HOME_RECENT_ACTIVITY = 2;
  92.   static final int LONG_PRESS_HOME_RECENT_DIALOG = 1;
  93.   static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1;
  94.   static final int LONG_PRESS_POWER_NOTHING = 0;
  95.   static final int LONG_PRESS_POWER_SHUT_OFF = 2;
  96.   static final int PHONE_LAYER = 3;
  97.   static final int POINTER_LAYER = 20;
  98.   static final boolean PRINT_ANIM = false;
  99.   static final int PRIORITY_PHONE_LAYER = 10;
  100.   static final int SEARCH_BAR_LAYER = 4;
  101.   static final int SECURE_SYSTEM_OVERLAY_LAYER = 19;
  102.   static final boolean SHOW_PROCESSES_ON_ALT_MENU = false;
  103.   static final boolean SHOW_STARTING_ANIMATIONS = true;
  104.   static final int STATUS_BAR_LAYER = 8;
  105.   static final int STATUS_BAR_PANEL_LAYER = 9;
  106.   static final int STATUS_BAR_SUB_PANEL_LAYER = 5;
  107.   private static final int SW_LID = 0;
  108.   static final int SYSTEM_ALERT_LAYER = 11;
  109.   static final int SYSTEM_DIALOG_LAYER = 6;
  110.   public static final String SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS = "globalactions";
  111.   public static final String SYSTEM_DIALOG_REASON_HOME_KEY = "homekey";
  112.   public static final String SYSTEM_DIALOG_REASON_KEY = "reason";
  113.   public static final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps";
  114.   static final int SYSTEM_ERROR_LAYER = 12;
  115.   static final int SYSTEM_OVERLAY_LAYER = 18;
  116.   static final String TAG = "WindowManager";
  117.   static final int TOAST_LAYER = 7;
  118.   static final int WALLPAPER_LAYER = 2;
  119.   private static final int[] WINDOW_TYPES_WHERE_HOME_DOESNT_WORK;
  120.   static final boolean localLOGV;
  121.   static final Rect mTmpContentFrame;
  122.   static final Rect mTmpDisplayFrame;
  123.   static final Rect mTmpParentFrame = new Rect();
  124.   static final Rect mTmpVisibleFrame;
  125.   int mAccelerometerDefault;
  126.   boolean mAllowAllRotations;
  127.   boolean mAllowLockscreenWhenOn;
  128.   BroadcastReceiver mBroadcastDone;
  129.   PowerManager.WakeLock mBroadcastWakeLock;
  130.   boolean mCarDockEnablesAccelerometer;
  131.   Intent mCarDockIntent;
  132.   int mCarDockRotation;
  133.   boolean mConsumeShortcutKeyUp;
  134.   int mContentBottom;
  135.   int mContentLeft;
  136.   int mContentRight;
  137.   int mContentTop;
  138.   Context mContext;
  139.   int mCurBottom;
  140.   int mCurLeft;
  141.   int mCurRight;
  142.   int mCurTop;
  143.   int mCurrentAppOrientation;
  144.   boolean mDeskDockEnablesAccelerometer;
  145.   Intent mDeskDockIntent;
  146.   int mDeskDockRotation;
  147.   boolean mDismissKeyguard;
  148.   int mDockBottom;
  149.   int mDockLayer;
  150.   int mDockLeft;
  151.   int mDockMode;
  152.   BroadcastReceiver mDockReceiver;
  153.   int mDockRight;
  154.   int mDockTop;
  155.   boolean mEnableShiftMenuBugReports;
  156.   int mEndcallBehavior;
  157.   final KeyCharacterMap.FallbackAction mFallbackAction;
  158.   int mFancyRotationAnimation;
  159.   WindowManagerPolicy.WindowState mFocusedWindow;
  160.   boolean mForceStatusBar;
  161.   GlobalActions mGlobalActions;
  162.   private UEventObserver mHDMIObserver;
  163.   Handler mHandler;
  164.   boolean mHasSoftInput;
  165.   boolean mHdmiPlugged;
  166.   boolean mHideLockScreen;
  167.   Intent mHomeIntent;
  168.   Runnable mHomeLongPress;
  169.   boolean mHomePressed;
  170.   int mIncallPowerBehavior;
  171.   long[] mKeyboardTapVibePattern;
  172.   WindowManagerPolicy.WindowState mKeyguard;
  173.   KeyguardViewMediator mKeyguardMediator;
  174.   int mLandscapeRotation;
  175.   WindowManagerPolicy.WindowState mLastTopAppWindowState;
  176.   int mLidKeyboardAccessibility;
  177.   int mLidNavigationAccessibility;
  178.   int mLidOpen;
  179.   int mLidOpenRotation;
  180.   final Object mLock;
  181.   int mLockScreenTimeout;
  182.   boolean mLockScreenTimerActive;
  183.   private int mLongPressOnHomeBehavior;
  184.   int mLongPressOnPowerBehavior;
  185.   long[] mLongPressVibePattern;
  186.   MyOrientationListener mOrientationListener;
  187.   boolean mOrientationSensorEnabled;
  188.   InputChannel mPointerLocationInputChannel;
  189.   private final InputHandler mPointerLocationInputHandler;
  190.   int mPointerLocationMode;
  191.   PointerLocationView mPointerLocationView;
  192.   int mPortraitRotation;
  193.   volatile boolean mPowerKeyHandled;
  194.   private final Runnable mPowerLongPress;
  195.   LocalPowerManager mPowerManager;
  196.   RecentApplicationsDialog mRecentAppsDialog;
  197.   int mRestrictedScreenHeight;
  198.   int mRestrictedScreenLeft;
  199.   int mRestrictedScreenTop;
  200.   int mRestrictedScreenWidth;
  201.   boolean mSafeMode;
  202.   long[] mSafeModeDisabledVibePattern;
  203.   long[] mSafeModeEnabledVibePattern;
  204.   Runnable mScreenLockTimeout;
  205.   boolean mScreenOn;
  206.   int mSeascapeRotation;
  207.   int mShortcutKeyPressed;
  208.   ShortcutManager mShortcutManager;
  209.   WindowManagerPolicy.WindowState mStatusBar;
  210.   boolean mStatusBarCanHide;
  211.   int mStatusBarHeight;
  212.   final ArrayList<WindowManagerPolicy.WindowState> mStatusBarPanels;
  213.   IStatusBarService mStatusBarService;
  214.   boolean mSystemReady;
  215.   WindowManagerPolicy.WindowState mTopAppWindowState;
  216.   WindowManagerPolicy.WindowState mTopFullscreenOpaqueWindowState;
  217.   boolean mTopIsFullscreen;
  218.   int mUiMode;
  219.   int mUnrestrictedScreenHeight;
  220.   int mUnrestrictedScreenLeft;
  221.   int mUnrestrictedScreenTop;
  222.   int mUnrestrictedScreenWidth;
  223.   int mUpsideDownRotation;
  224.   int mUserRotation;
  225.   int mUserRotationMode;
  226.   Vibrator mVibrator;
  227.   long[] mVirtualKeyVibePattern;
  228.   Runnable mVolumeDownLongPress;
  229.   Runnable mVolumeUpLongPress;
  230.   IWindowManager mWindowManager;
  231.  
  232.   static
  233.   {
  234.     mTmpDisplayFrame = new Rect();
  235.     mTmpContentFrame = new Rect();
  236.     mTmpVisibleFrame = new Rect();
  237.     WINDOW_TYPES_WHERE_HOME_DOESNT_WORK = new int[] { 2003, 2010 };
  238.   }
  239.  
  240.   public PhoneWindowManager()
  241.   {
  242.     Object localObject = new Object();
  243.     this.mLock = localObject;
  244.     this.mEnableShiftMenuBugReports = 0;
  245.     this.mStatusBar = null;
  246.     ArrayList localArrayList = new ArrayList();
  247.     this.mStatusBarPanels = localArrayList;
  248.     this.mKeyguard = null;
  249.     this.mLidOpen = -1;
  250.     this.mUiMode = 1;
  251.     this.mDockMode = 0;
  252.     this.mUserRotationMode = 0;
  253.     this.mUserRotation = 0;
  254.     this.mLongPressOnPowerBehavior = -1;
  255.     this.mScreenOn = 0;
  256.     this.mOrientationSensorEnabled = 0;
  257.     this.mCurrentAppOrientation = -1;
  258.     this.mAccelerometerDefault = 0;
  259.     this.mHasSoftInput = 0;
  260.     this.mPointerLocationMode = 0;
  261.     this.mPointerLocationView = null;
  262.     PhoneWindowManager.1 local1 = new PhoneWindowManager.1(this);
  263.     this.mPointerLocationInputHandler = local1;
  264.     this.mShortcutKeyPressed = -1;
  265.     this.mLandscapeRotation = 0;
  266.     this.mSeascapeRotation = 0;
  267.     this.mPortraitRotation = 0;
  268.     this.mUpsideDownRotation = 0;
  269.     this.mLongPressOnHomeBehavior = -1;
  270.     KeyCharacterMap.FallbackAction localFallbackAction = new KeyCharacterMap.FallbackAction();
  271.     this.mFallbackAction = localFallbackAction;
  272.     PhoneWindowManager.2 local2 = new PhoneWindowManager.2(this);
  273.     this.mHDMIObserver = local2;
  274.     PhoneWindowManager.3 local3 = new PhoneWindowManager.3(this);
  275.     this.mPowerLongPress = local3;
  276.     PhoneWindowManager.VolumeLongPressF localVolumeLongPressF = new PhoneWindowManager.VolumeLongPressF(this);
  277.     this.mVolumeUpLongPress = localVolumeLongPressF;
  278.     PhoneWindowManager.VolumeLongPressR localVolumeLongPressR = new PhoneWindowManager.VolumeLongPressR(this);
  279.     this.mVolumeDownLongPress = localVolumeLongPressR;
  280.     PhoneWindowManager.4 local4 = new PhoneWindowManager.4(this);
  281.     this.mHomeLongPress = local4;
  282.     PhoneWindowManager.9 local9 = new PhoneWindowManager.9(this);
  283.     this.mBroadcastDone = local9;
  284.     PhoneWindowManager.10 local10 = new PhoneWindowManager.10(this);
  285.     this.mDockReceiver = local10;
  286.     PhoneWindowManager.12 local12 = new PhoneWindowManager.12(this);
  287.     this.mScreenLockTimeout = local12;
  288.   }
  289.  
  290.   private int determineHiddenState(int paramInt1, int paramInt2, int paramInt3)
  291.   {
  292.     if (this.mLidOpen != -1);
  293.     int i;
  294.     switch (paramInt1)
  295.     {
  296.     default:
  297.       i = paramInt3;
  298.     case 1:
  299.     case 2:
  300.     }
  301.     while (true)
  302.     {
  303.       return i;
  304.       if (this.mLidOpen == 1)
  305.       {
  306.         i = paramInt3;
  307.         continue;
  308.       }
  309.       i = paramInt2;
  310.       continue;
  311.       if (this.mLidOpen == 1)
  312.       {
  313.         i = paramInt2;
  314.         continue;
  315.       }
  316.       i = paramInt3;
  317.     }
  318.   }
  319.  
  320.   static IAudioService getAudioService()
  321.   {
  322.     IAudioService localIAudioService = IAudioService.Stub.asInterface(ServiceManager.checkService("audio"));
  323.     if (localIAudioService == null)
  324.       int i = Log.w("WindowManager", "Unable to find IAudioService interface.");
  325.     return localIAudioService;
  326.   }
  327.  
  328.   private int getCurrentLandscapeRotation(int paramInt)
  329.   {
  330.     int j;
  331.     if (this.mUserRotationMode == 1)
  332.     {
  333.       int i = this.mUserRotation;
  334.       if (isLandscapeOrSeascape(i))
  335.         j = this.mUserRotation;
  336.     }
  337.     while (true)
  338.     {
  339.       return j;
  340.       j = this.mLandscapeRotation;
  341.       continue;
  342.       int k = this.mOrientationListener.getCurrentRotation(paramInt);
  343.       if (isLandscapeOrSeascape(k))
  344.       {
  345.         j = k;
  346.         continue;
  347.       }
  348.       if (isLandscapeOrSeascape(paramInt))
  349.       {
  350.         j = paramInt;
  351.         continue;
  352.       }
  353.       j = this.mLandscapeRotation;
  354.     }
  355.   }
  356.  
  357.   private int getCurrentPortraitRotation(int paramInt)
  358.   {
  359.     int j;
  360.     if (this.mUserRotationMode == 1)
  361.     {
  362.       int i = this.mUserRotation;
  363.       if (isAnyPortrait(i))
  364.         j = this.mUserRotation;
  365.     }
  366.     while (true)
  367.     {
  368.       return j;
  369.       j = this.mPortraitRotation;
  370.       continue;
  371.       int k = this.mOrientationListener.getCurrentRotation(paramInt);
  372.       if (isAnyPortrait(k))
  373.       {
  374.         j = k;
  375.         continue;
  376.       }
  377.       if (isAnyPortrait(paramInt))
  378.       {
  379.         j = paramInt;
  380.         continue;
  381.       }
  382.       j = this.mPortraitRotation;
  383.     }
  384.   }
  385.  
  386.   private boolean getFallbackAction(KeyCharacterMap paramKeyCharacterMap, int paramInt1, int paramInt2, KeyCharacterMap.FallbackAction paramFallbackAction)
  387.   {
  388.     return paramKeyCharacterMap.getFallbackAction(paramInt1, paramInt2, paramFallbackAction);
  389.   }
  390.  
  391.   static long[] getLongIntArray(Resources paramResources, int paramInt)
  392.   {
  393.     int[] arrayOfInt = paramResources.getIntArray(paramInt);
  394.     if (arrayOfInt == null);
  395.     int j;
  396.     for (int i = 0; ; i = j)
  397.     {
  398.       return i;
  399.       j = arrayOfInt.length;
  400.       int k = 0;
  401.       while (true)
  402.       {
  403.         int m = arrayOfInt.length;
  404.         if (k >= m)
  405.           break;
  406.         long l = arrayOfInt[k];
  407.         j[k] = l;
  408.         k += 1;
  409.       }
  410.     }
  411.   }
  412.  
  413.   static ITelephony getTelephonyService()
  414.   {
  415.     ITelephony localITelephony = ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
  416.     if (localITelephony == null)
  417.       int i = Log.w("WindowManager", "Unable to find ITelephony interface.");
  418.     return localITelephony;
  419.   }
  420.  
  421.   private void handleLongPressOnHome()
  422.   {
  423.     if (this.mLongPressOnHomeBehavior < 0)
  424.     {
  425.       int i = this.mContext.getResources().getInteger(17694746);
  426.       this.mLongPressOnHomeBehavior = i;
  427.       if ((this.mLongPressOnHomeBehavior < 0) || (this.mLongPressOnHomeBehavior > 2))
  428.         this.mLongPressOnHomeBehavior = 0;
  429.     }
  430.     if (this.mLongPressOnHomeBehavior != 0)
  431.     {
  432.       boolean bool = performHapticFeedbackLw(null, 0, 0);
  433.       sendCloseSystemWindows("recentapps");
  434.       this.mHomePressed = 0;
  435.     }
  436.     if (this.mLongPressOnHomeBehavior == 1)
  437.     {
  438.       showOrHideRecentAppsDialog(0, 1);
  439.       return;
  440.     }
  441.     if (this.mLongPressOnHomeBehavior != 2)
  442.       return;
  443.     try
  444.     {
  445.       Intent localIntent1 = new Intent();
  446.       Intent localIntent2 = localIntent1.setClassName("com.android.systemui", "com.android.systemui.recent.RecentApplicationsActivity");
  447.       Intent localIntent3 = localIntent1.setFlags(276824064);
  448.       this.mContext.startActivity(localIntent1);
  449.       return;
  450.     }
  451.     catch (ActivityNotFoundException localActivityNotFoundException)
  452.     {
  453.       int j = Log.e("WindowManager", "Failed to launch RecentAppsIntent", localActivityNotFoundException);
  454.     }
  455.   }
  456.  
  457.   private void interceptPowerKeyDown(boolean paramBoolean)
  458.   {
  459.     this.mPowerKeyHandled = paramBoolean;
  460.     if (paramBoolean)
  461.       return;
  462.     Handler localHandler = this.mHandler;
  463.     Runnable localRunnable = this.mPowerLongPress;
  464.     long l = ViewConfiguration.getGlobalActionKeyTimeout();
  465.     boolean bool = localHandler.postDelayed(localRunnable, l);
  466.   }
  467.  
  468.   private boolean interceptPowerKeyUp(boolean paramBoolean)
  469.   {
  470.     int i;
  471.     if (!this.mPowerKeyHandled)
  472.     {
  473.       Handler localHandler = this.mHandler;
  474.       Runnable localRunnable = this.mPowerLongPress;
  475.       localHandler.removeCallbacks(localRunnable);
  476.       if (!paramBoolean)
  477.         i = 1;
  478.     }
  479.     while (true)
  480.     {
  481.       return i;
  482.       i = 0;
  483.       continue;
  484.       this.mPowerKeyHandled = 1;
  485.       i = 0;
  486.     }
  487.   }
  488.  
  489.   private boolean isAnyPortrait(int paramInt)
  490.   {
  491.     int i = this.mPortraitRotation;
  492.     if (paramInt != i)
  493.     {
  494.       int j = this.mUpsideDownRotation;
  495.       if (paramInt != j)
  496.         break label26;
  497.     }
  498.     label26: for (int k = 1; ; k = 0)
  499.       return k;
  500.   }
  501.  
  502.   private boolean isLandscapeOrSeascape(int paramInt)
  503.   {
  504.     int i = this.mLandscapeRotation;
  505.     if (paramInt != i)
  506.     {
  507.       int j = this.mSeascapeRotation;
  508.       if (paramInt != j)
  509.         break label26;
  510.     }
  511.     label26: for (int k = 1; ; k = 0)
  512.       return k;
  513.   }
  514.  
  515.   private boolean keyguardIsShowingTq()
  516.   {
  517.     return this.mKeyguardMediator.isShowingAndNotHidden();
  518.   }
  519.  
  520.   private int readRotation(int paramInt)
  521.   {
  522.     try
  523.     {
  524.       int i = this.mContext.getResources().getInteger(paramInt);
  525.       label56: int j;
  526.       switch (i)
  527.       {
  528.       default:
  529.         j = -1;
  530.       case 0:
  531.       case 90:
  532.       case 180:
  533.       case 270:
  534.       }
  535.       while (true)
  536.       {
  537.         return j;
  538.         j = 0;
  539.         continue;
  540.         j = 1;
  541.         continue;
  542.         j = 2;
  543.         continue;
  544.         j = 3;
  545.       }
  546.     }
  547.     catch (Resources.NotFoundException localNotFoundException)
  548.     {
  549.       break label56;
  550.     }
  551.   }
  552.  
  553.   static void sendCloseSystemWindows(Context paramContext, String paramString)
  554.   {
  555.     if (!ActivityManagerNative.isSystemReady())
  556.       return;
  557.     try
  558.     {
  559.       ActivityManagerNative.getDefault().closeSystemDialogs(paramString);
  560.       return;
  561.     }
  562.     catch (RemoteException localRemoteException)
  563.     {
  564.     }
  565.   }
  566.  
  567.   private void updateLockScreenTimeout()
  568.   {
  569.     synchronized (this.mScreenLockTimeout)
  570.     {
  571.       if ((this.mAllowLockscreenWhenOn) && (this.mScreenOn) && (this.mKeyguardMediator.isSecure()));
  572.       for (int i = 1; ; i = 0)
  573.       {
  574.         if (this.mLockScreenTimerActive != i)
  575.         {
  576.           if (i == 0)
  577.             break;
  578.           Handler localHandler1 = this.mHandler;
  579.           Runnable localRunnable2 = this.mScreenLockTimeout;
  580.           long l = this.mLockScreenTimeout;
  581.           boolean bool = localHandler1.postDelayed(localRunnable2, l);
  582.           this.mLockScreenTimerActive = i;
  583.         }
  584.         return;
  585.       }
  586.       Handler localHandler2 = this.mHandler;
  587.       Runnable localRunnable3 = this.mScreenLockTimeout;
  588.       localHandler2.removeCallbacks(localRunnable3);
  589.     }
  590.   }
  591.  
  592.   private void updateSystemUiVisibility()
  593.   {
  594.     if (this.mFocusedWindow == null)
  595.       return;
  596.     WindowManager.LayoutParams localLayoutParams = this.mFocusedWindow.getAttrs();
  597.     int i = localLayoutParams.systemUiVisibility;
  598.     int j = localLayoutParams.subtreeSystemUiVisibility;
  599.     int k = i | j;
  600.     Handler localHandler = this.mHandler;
  601.     PhoneWindowManager.13 local13 = new PhoneWindowManager.13(this, k);
  602.     boolean bool = localHandler.post(local13);
  603.   }
  604.  
  605.   // ERROR //
  606.   public View addStartingWindow(IBinder paramIBinder, String paramString, int paramInt1, android.content.res.CompatibilityInfo paramCompatibilityInfo, java.lang.CharSequence paramCharSequence, int paramInt2, int paramInt3, int paramInt4)
  607.   {
  608.     // Byte code:
  609.     //   0: aload_2
  610.     //   1: ifnonnull +9 -> 10
  611.     //   4: aconst_null
  612.     //   5: astore 9
  613.     //   7: aload 9
  614.     //   9: areturn
  615.     //   10: aload_0
  616.     //   11: getfield 435   com/android/internal/policy/impl/PhoneWindowManager:mContext    Landroid/content/Context;
  617.     //   14: astore 10
  618.     //   16: aload 10
  619.     //   18: invokevirtual 586  android/content/Context:getThemeResId   ()I
  620.     //   21: istore 11
  621.     //   23: iload 11
  622.     //   25: istore 12
  623.     //   27: iload_3
  624.     //   28: istore 13
  625.     //   30: iload 12
  626.     //   32: istore 14
  627.     //   34: iload 13
  628.     //   36: iload 14
  629.     //   38: if_icmpne +8 -> 46
  630.     //   41: iload 6
  631.     //   43: ifeq +30 -> 73
  632.     //   46: aconst_null
  633.     //   47: astore 9
  634.     //   49: aload 10
  635.     //   51: aload_2
  636.     //   52: aload 9
  637.     //   54: invokevirtual 590  android/content/Context:createPackageContext    (Ljava/lang/String;I)Landroid/content/Context;
  638.     //   57: astore 10
  639.     //   59: aload 10
  640.     //   61: astore 15
  641.     //   63: iload_3
  642.     //   64: istore 16
  643.     //   66: aload 15
  644.     //   68: iload 16
  645.     //   70: invokevirtual 594  android/content/Context:setTheme    (I)V
  646.     //   73: aload 10
  647.     //   75: invokestatic 600   com/android/internal/policy/PolicyManager:makeNewWindow (Landroid/content/Context;)Landroid/view/Window;
  648.     //   78: astore 17
  649.     //   80: aload 17
  650.     //   82: invokevirtual 606  android/view/Window:getWindowStyle  ()Landroid/content/res/TypedArray;
  651.     //   85: bipush 12
  652.     //   87: ldc 31
  653.     //   89: invokevirtual 612  android/content/res/TypedArray:getBoolean   (IZ)Z
  654.     //   92: ifeq +9 -> 101
  655.     //   95: aconst_null
  656.     //   96: astore 9
  657.     //   98: goto -91 -> 7
  658.     //   101: aload 10
  659.     //   103: invokevirtual 441 android/content/Context:getResources    ()Landroid/content/res/Resources;
  660.     //   106: astore 18
  661.     //   108: iload 6
  662.     //   110: istore 19
  663.     //   112: aload 5
  664.     //   114: astore 20
  665.     //   116: aload 18
  666.     //   118: iload 19
  667.     //   120: aload 20
  668.     //   122: invokevirtual 616 android/content/res/Resources:getText   (ILjava/lang/CharSequence;)Ljava/lang/CharSequence;
  669.     //   125: astore 21
  670.     //   127: aload 17
  671.     //   129: aload 21
  672.     //   131: invokevirtual 620 android/view/Window:setTitle    (Ljava/lang/CharSequence;)V
  673.     //   134: aload 17
  674.     //   136: iconst_3
  675.     //   137: invokevirtual 623 android/view/Window:setType (I)V
  676.     //   140: iload 8
  677.     //   142: bipush 16
  678.     //   144: ior
  679.     //   145: bipush 8
  680.     //   147: ior
  681.     //   148: ldc_w 624
  682.     //   151: ior
  683.     //   152: istore 22
  684.     //   154: iload 8
  685.     //   156: bipush 16
  686.     //   158: ior
  687.     //   159: bipush 8
  688.     //   161: ior
  689.     //   162: ldc_w 624
  690.     //   165: ior
  691.     //   166: istore 23
  692.     //   168: aload 17
  693.     //   170: iload 22
  694.     //   172: iload 23
  695.     //   174: invokevirtual 627 android/view/Window:setFlags    (II)V
  696.     //   177: aload 4
  697.     //   179: invokevirtual 632 android/content/res/CompatibilityInfo:supportsScreen    ()Z
  698.     //   182: ifne +11 -> 193
  699.     //   185: aload 17
  700.     //   187: ldc_w 633
  701.     //   190: invokevirtual 636 android/view/Window:addFlags    (I)V
  702.     //   193: aload 17
  703.     //   195: bipush 255
  704.     //   197: bipush 255
  705.     //   199: invokevirtual 639 android/view/Window:setLayout   (II)V
  706.     //   202: aload 17
  707.     //   204: invokevirtual 642 android/view/Window:getAttributes   ()Landroid/view/WindowManager$LayoutParams;
  708.     //   207: astore 24
  709.     //   209: aload 24
  710.     //   211: aload_1
  711.     //   212: putfield 646  android/view/WindowManager$LayoutParams:token   Landroid/os/IBinder;
  712.     //   215: aload 24
  713.     //   217: aload_2
  714.     //   218: putfield 649  android/view/WindowManager$LayoutParams:packageName Ljava/lang/String;
  715.     //   221: aload 17
  716.     //   223: invokevirtual 606 android/view/Window:getWindowStyle  ()Landroid/content/res/TypedArray;
  717.     //   226: bipush 8
  718.     //   228: iconst_0
  719.     //   229: invokevirtual 653 android/content/res/TypedArray:getResourceId    (II)I
  720.     //   232: istore 25
  721.     //   234: aload 24
  722.     //   236: iload 25
  723.     //   238: putfield 656  android/view/WindowManager$LayoutParams:windowAnimations    I
  724.     //   241: new 658   java/lang/StringBuilder
  725.     //   244: dup
  726.     //   245: invokespecial 659 java/lang/StringBuilder:<init>  ()V
  727.     //   248: ldc_w 661
  728.     //   251: invokevirtual 665 java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  729.     //   254: aload_2
  730.     //   255: invokevirtual 665 java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  731.     //   258: invokevirtual 669 java/lang/StringBuilder:toString    ()Ljava/lang/String;
  732.     //   261: astore 26
  733.     //   263: aload 24
  734.     //   265: aload 26
  735.     //   267: invokevirtual 670 android/view/WindowManager$LayoutParams:setTitle    (Ljava/lang/CharSequence;)V
  736.     //   270: aload 10
  737.     //   272: ldc_w 672
  738.     //   275: invokevirtual 676 android/content/Context:getSystemService    (Ljava/lang/String;)Ljava/lang/Object;
  739.     //   278: checkcast 678 android/view/WindowManager
  740.     //   281: astore 27
  741.     //   283: aload 17
  742.     //   285: invokevirtual 682 android/view/Window:getDecorView    ()Landroid/view/View;
  743.     //   288: astore 28
  744.     //   290: aload 17
  745.     //   292: invokevirtual 685 android/view/Window:isFloating  ()Z
  746.     //   295: ifeq +9 -> 304
  747.     //   298: aconst_null
  748.     //   299: astore 9
  749.     //   301: goto -294 -> 7
  750.     //   304: aload 27
  751.     //   306: aload 28
  752.     //   308: aload 24
  753.     //   310: invokeinterface 689 3 0
  754.     //   315: aload 28
  755.     //   317: invokevirtual 695 android/view/View:getParent ()Landroid/view/ViewParent;
  756.     //   320: astore 11
  757.     //   322: aload 11
  758.     //   324: ifnull +10 -> 334
  759.     //   327: aload 28
  760.     //   329: astore 9
  761.     //   331: goto -324 -> 7
  762.     //   334: aconst_null
  763.     //   335: astore 9
  764.     //   337: goto -330 -> 7
  765.     //   340: astore 29
  766.     //   342: new 658   java/lang/StringBuilder
  767.     //   345: dup
  768.     //   346: invokespecial 659 java/lang/StringBuilder:<init>  ()V
  769.     //   349: aload_1
  770.     //   350: invokevirtual 698 java/lang/StringBuilder:append  (Ljava/lang/Object;)Ljava/lang/StringBuilder;
  771.     //   353: ldc_w 700
  772.     //   356: invokevirtual 665 java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  773.     //   359: invokevirtual 669 java/lang/StringBuilder:toString    ()Ljava/lang/String;
  774.     //   362: astore 30
  775.     //   364: ldc 97
  776.     //   366: aload 30
  777.     //   368: invokestatic 390  android/util/Log:w  (Ljava/lang/String;Ljava/lang/String;)I
  778.     //   371: istore 31
  779.     //   373: aconst_null
  780.     //   374: astore 9
  781.     //   376: goto -369 -> 7
  782.     //   379: astore 32
  783.     //   381: new 658   java/lang/StringBuilder
  784.     //   384: dup
  785.     //   385: invokespecial 659 java/lang/StringBuilder:<init>  ()V
  786.     //   388: aload_1
  787.     //   389: invokevirtual 698 java/lang/StringBuilder:append  (Ljava/lang/Object;)Ljava/lang/StringBuilder;
  788.     //   392: ldc_w 702
  789.     //   395: invokevirtual 665 java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  790.     //   398: invokevirtual 669 java/lang/StringBuilder:toString    ()Ljava/lang/String;
  791.     //   401: astore 33
  792.     //   403: ldc 97
  793.     //   405: aload 33
  794.     //   407: aload 32
  795.     //   409: invokestatic 704  android/util/Log:w  (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
  796.     //   412: istore 34
  797.     //   414: goto -41 -> 373
  798.     //   417: astore 35
  799.     //   419: goto -346 -> 73
  800.     //
  801.     // Exception table:
  802.     //   from   to  target  type
  803.     //   10 23  340 android/view/WindowManager$BadTokenException
  804.     //   49 73  340 android/view/WindowManager$BadTokenException
  805.     //   73 322 340 android/view/WindowManager$BadTokenException
  806.     //   10 23  379 java/lang/RuntimeException
  807.     //   49 73  379 java/lang/RuntimeException
  808.     //   73 322 379 java/lang/RuntimeException
  809.     //   49 73  417 android/content/pm/PackageManager$NameNotFoundException
  810.   }
  811.  
  812.   public void adjustConfigurationLw(Configuration paramConfiguration)
  813.   {
  814.     readLidState();
  815.     LocalPowerManager localLocalPowerManager = this.mPowerManager;
  816.     if (this.mLidOpen == 1)
  817.     {
  818.       int i = 1;
  819.       localLocalPowerManager.setKeyboardVisibility(i);
  820.       if (paramConfiguration.keyboard != 1)
  821.         break label80;
  822.       paramConfiguration.hardKeyboardHidden = 2;
  823.       label40: if (paramConfiguration.navigation != 1)
  824.         break label105;
  825.     }
  826.     label80: label105: int i1;
  827.     for (paramConfiguration.navigationHidden = 2; ; paramConfiguration.navigationHidden = i1)
  828.     {
  829.       if ((!this.mHasSoftInput) && (paramConfiguration.hardKeyboardHidden != 1))
  830.         break label130;
  831.       paramConfiguration.keyboardHidden = 1;
  832.       return;
  833.       int j = 0;
  834.       break;
  835.       int k = this.mLidKeyboardAccessibility;
  836.       int m = determineHiddenState(k, 2, 1);
  837.       paramConfiguration.hardKeyboardHidden = m;
  838.       break label40;
  839.       int n = this.mLidNavigationAccessibility;
  840.       i1 = determineHiddenState(n, 2, 1);
  841.     }
  842.     label130: paramConfiguration.keyboardHidden = 2;
  843.   }
  844.  
  845.   public void adjustWindowParamsLw(WindowManager.LayoutParams paramLayoutParams)
  846.   {
  847.     switch (paramLayoutParams.type)
  848.     {
  849.     default:
  850.       return;
  851.     case 2005:
  852.     case 2006:
  853.     case 2015:
  854.     }
  855.     int i = paramLayoutParams.flags | 0x18;
  856.     paramLayoutParams.flags = i;
  857.   }
  858.  
  859.   public boolean allowAppAnimationsLw()
  860.   {
  861.     if ((this.mKeyguard != null) && (this.mKeyguard.isVisibleLw()));
  862.     for (int i = 0; ; i = 1)
  863.       return i;
  864.   }
  865.  
  866.   public boolean allowKeyRepeat()
  867.   {
  868.     return this.mScreenOn;
  869.   }
  870.  
  871.   public void animatingWindowLw(WindowManagerPolicy.WindowState paramWindowState, WindowManager.LayoutParams paramLayoutParams)
  872.   {
  873.     if ((this.mTopFullscreenOpaqueWindowState == null) && (paramWindowState.isVisibleOrBehindKeyguardLw()))
  874.     {
  875.       if ((paramLayoutParams.flags & 0x800) != 0)
  876.         this.mForceStatusBar = 1;
  877.       if ((paramLayoutParams.type >= 1) && (paramLayoutParams.type <= 99) && (paramLayoutParams.x == 0) && (paramLayoutParams.y == 0) && (paramLayoutParams.width == -1) && (paramLayoutParams.height == -1))
  878.       {
  879.         this.mTopFullscreenOpaqueWindowState = paramWindowState;
  880.         if ((paramLayoutParams.flags & 0x80000) != 0)
  881.           this.mHideLockScreen = 1;
  882.         if ((paramLayoutParams.flags & 0x400000) != 0)
  883.           this.mDismissKeyguard = 1;
  884.         if ((paramLayoutParams.flags & 0x1) != 0)
  885.           this.mAllowLockscreenWhenOn = 1;
  886.       }
  887.     }
  888.     if (this.mTopAppWindowState != null)
  889.       return;
  890.     if (!paramWindowState.isVisibleOrBehindKeyguardLw())
  891.       return;
  892.     if (paramLayoutParams.type < 1)
  893.       return;
  894.     if (paramLayoutParams.type > 99)
  895.       return;
  896.     this.mTopAppWindowState = paramWindowState;
  897.   }
  898.  
  899.   public void beginAnimationLw(int paramInt1, int paramInt2)
  900.   {
  901.     this.mTopFullscreenOpaqueWindowState = null;
  902.     this.mTopAppWindowState = null;
  903.     this.mForceStatusBar = 0;
  904.     this.mHideLockScreen = 0;
  905.     this.mAllowLockscreenWhenOn = 0;
  906.     this.mDismissKeyguard = 0;
  907.   }
  908.  
  909.   public void beginLayoutLw(int paramInt1, int paramInt2)
  910.   {
  911.     this.mUnrestrictedScreenTop = 0;
  912.     this.mUnrestrictedScreenLeft = 0;
  913.     this.mUnrestrictedScreenWidth = paramInt1;
  914.     this.mUnrestrictedScreenHeight = paramInt2;
  915.     this.mRestrictedScreenTop = 0;
  916.     this.mRestrictedScreenLeft = 0;
  917.     this.mRestrictedScreenWidth = paramInt1;
  918.     this.mRestrictedScreenHeight = paramInt2;
  919.     this.mCurLeft = 0;
  920.     this.mContentLeft = 0;
  921.     this.mDockLeft = 0;
  922.     this.mCurTop = 0;
  923.     this.mContentTop = 0;
  924.     this.mDockTop = 0;
  925.     this.mCurRight = paramInt1;
  926.     this.mContentRight = paramInt1;
  927.     this.mDockRight = paramInt1;
  928.     this.mCurBottom = paramInt2;
  929.     this.mContentBottom = paramInt2;
  930.     this.mDockBottom = paramInt2;
  931.     this.mDockLayer = 268435456;
  932.     if (this.mStatusBar == null)
  933.       return;
  934.     Rect localRect1 = mTmpParentFrame;
  935.     Rect localRect2 = mTmpDisplayFrame;
  936.     Rect localRect3 = mTmpVisibleFrame;
  937.     localRect3.left = 0;
  938.     localRect2.left = 0;
  939.     localRect1.left = 0;
  940.     localRect3.top = 0;
  941.     localRect2.top = 0;
  942.     localRect1.top = 0;
  943.     localRect3.right = paramInt1;
  944.     localRect2.right = paramInt1;
  945.     localRect1.right = paramInt1;
  946.     localRect3.bottom = paramInt2;
  947.     localRect2.bottom = paramInt2;
  948.     localRect1.bottom = paramInt2;
  949.     this.mStatusBar.computeFrameLw(localRect1, localRect2, localRect3, localRect3);
  950.     if (!this.mStatusBar.isVisibleLw())
  951.       return;
  952.     Rect localRect4 = this.mStatusBar.getFrameLw();
  953.     if (this.mStatusBarCanHide)
  954.     {
  955.       int i = this.mDockTop;
  956.       int j = localRect4.top;
  957.       if (i == j)
  958.       {
  959.         int k = localRect4.bottom;
  960.         this.mDockTop = k;
  961.       }
  962.       while (true)
  963.       {
  964.         int m = this.mDockTop;
  965.         this.mCurTop = m;
  966.         this.mContentTop = m;
  967.         int n = this.mDockBottom;
  968.         this.mCurBottom = n;
  969.         this.mContentBottom = n;
  970.         return;
  971.         int i1 = this.mDockBottom;
  972.         int i2 = localRect4.bottom;
  973.         if (i1 != i2)
  974.           continue;
  975.         int i3 = localRect4.top;
  976.         this.mDockBottom = i3;
  977.       }
  978.     }
  979.     int i4 = this.mRestrictedScreenTop;
  980.     int i5 = localRect4.top;
  981.     if (i4 == i5)
  982.     {
  983.       int i6 = localRect4.bottom;
  984.       this.mRestrictedScreenTop = i6;
  985.       int i7 = this.mRestrictedScreenHeight;
  986.       int i8 = localRect4.bottom;
  987.       int i9 = localRect4.top;
  988.       int i10 = i8 - i9;
  989.       int i11 = i7 - i10;
  990.       this.mRestrictedScreenHeight = i11;
  991.     }
  992.     while (true)
  993.     {
  994.       int i12 = this.mRestrictedScreenTop;
  995.       this.mDockTop = i12;
  996.       this.mCurTop = i12;
  997.       this.mContentTop = i12;
  998.       int i13 = this.mRestrictedScreenTop;
  999.       int i14 = this.mRestrictedScreenHeight;
  1000.       int i15 = i13 + i14;
  1001.       this.mDockBottom = i15;
  1002.       this.mCurBottom = i15;
  1003.       this.mContentBottom = i15;
  1004.       return;
  1005.       int i16 = this.mRestrictedScreenHeight;
  1006.       int i17 = this.mRestrictedScreenTop;
  1007.       int i18 = i16 - i17;
  1008.       int i19 = localRect4.bottom;
  1009.       if (i18 != i19)
  1010.         continue;
  1011.       int i20 = this.mRestrictedScreenHeight;
  1012.       int i21 = localRect4.bottom;
  1013.       int i22 = localRect4.top;
  1014.       int i23 = i21 - i22;
  1015.       int i24 = i20 - i23;
  1016.       this.mRestrictedScreenHeight = i24;
  1017.     }
  1018.   }
  1019.  
  1020.   public boolean canBeForceHidden(WindowManagerPolicy.WindowState paramWindowState, WindowManager.LayoutParams paramLayoutParams)
  1021.   {
  1022.     if ((paramLayoutParams.type != 2000) && (paramLayoutParams.type != 2013));
  1023.     for (int i = 1; ; i = 0)
  1024.       return i;
  1025.   }
  1026.  
  1027.   public boolean canStatusBarHide()
  1028.   {
  1029.     return this.mStatusBarCanHide;
  1030.   }
  1031.  
  1032.   public int checkAddPermission(WindowManager.LayoutParams paramLayoutParams)
  1033.   {
  1034.     int i = paramLayoutParams.type;
  1035.     int j;
  1036.     if ((i < 2000) || (i > 2999))
  1037.       j = 0;
  1038.     while (true)
  1039.     {
  1040.       return j;
  1041.       String str = null;
  1042.       switch (i)
  1043.       {
  1044.       case 2004:
  1045.       case 2008:
  1046.       case 2009:
  1047.       case 2012:
  1048.       default:
  1049.       case 2005:
  1050.       case 2011:
  1051.       case 2013:
  1052.       case 2002:
  1053.       case 2003:
  1054.       case 2006:
  1055.       case 2007:
  1056.       case 2010:
  1057.       }
  1058.       for (str = "android.permission.INTERNAL_SYSTEM_WINDOW"; ; str = "android.permission.SYSTEM_ALERT_WINDOW")
  1059.       {
  1060.         if ((str == null) || (this.mContext.checkCallingOrSelfPermission(str) == 0))
  1061.           break label124;
  1062.         j = -1;
  1063.         break;
  1064.       }
  1065.       label124: j = 0;
  1066.     }
  1067.   }
  1068.  
  1069.   public Animation createForceHideEnterAnimation()
  1070.   {
  1071.     return AnimationUtils.loadAnimation(this.mContext, 17432605);
  1072.   }
  1073.  
  1074.   Intent createHomeDockIntent()
  1075.   {
  1076.     Intent localIntent1;
  1077.     ActivityInfo localActivityInfo;
  1078.     Object localObject;
  1079.     if (this.mUiMode == 3)
  1080.     {
  1081.       localIntent1 = this.mCarDockIntent;
  1082.       PackageManager localPackageManager = this.mContext.getPackageManager();
  1083.       localActivityInfo = localIntent1.resolveActivityInfo(localPackageManager, 128);
  1084.       if (localActivityInfo != null)
  1085.         break label62;
  1086.       localObject = null;
  1087.     }
  1088.     while (true)
  1089.     {
  1090.       return localObject;
  1091.       if (this.mUiMode == 2)
  1092.       {
  1093.         localIntent1 = this.mDeskDockIntent;
  1094.         break;
  1095.       }
  1096.       localObject = null;
  1097.       continue;
  1098.       label62: if ((localActivityInfo.metaData != null) && (localActivityInfo.metaData.getBoolean("android.dock_home")))
  1099.       {
  1100.         Intent localIntent2 = new Intent(localIntent1);
  1101.         String str1 = localActivityInfo.packageName;
  1102.         String str2 = localActivityInfo.name;
  1103.         Intent localIntent3 = localIntent2.setClassName(str1, str2);
  1104.         localObject = localIntent2;
  1105.         continue;
  1106.       }
  1107.       localObject = null;
  1108.     }
  1109.   }
  1110.  
  1111.   public boolean detectSafeMode()
  1112.   {
  1113.     try
  1114.     {
  1115.       int i = this.mWindowManager.getKeycodeState(82);
  1116.       int j = this.mWindowManager.getKeycodeState(47);
  1117.       int k = this.mWindowManager.getDPadKeycodeState(23);
  1118.       int m = this.mWindowManager.getTrackballScancodeState(272);
  1119.       int n = this.mWindowManager.getKeycodeState(25);
  1120.       int i3;
  1121.       if ((i > 0) || (j > 0) || (k > 0) || (m > 0) || (n > 0))
  1122.       {
  1123.         int i1 = 1;
  1124.         this.mSafeMode = i1;
  1125.         i1 = 0;
  1126.         if (!this.mSafeMode)
  1127.           break label210;
  1128.         i3 = 10001;
  1129.         label111: boolean bool = performHapticFeedbackLw(i1, i3, 1);
  1130.         if (!this.mSafeMode)
  1131.           break label218;
  1132.         String str = "SAFE MODE ENABLED (menu=" + i + " s=" + j + " dpad=" + k + " trackball=" + m + ")";
  1133.         int i4 = Log.i("WindowManager", str);
  1134.       }
  1135.       while (true)
  1136.       {
  1137.         return this.mSafeMode;
  1138.         int i2 = 0;
  1139.         break;
  1140.         label210: i3 = 10000;
  1141.         break label111;
  1142.         label218: int i5 = Log.i("WindowManager", "SAFE MODE not enabled");
  1143.       }
  1144.     }
  1145.     catch (RemoteException localRemoteException)
  1146.     {
  1147.     }
  1148.     throw new RuntimeException("window manager dead");
  1149.   }
  1150.  
  1151.   public KeyEvent dispatchUnhandledKey(WindowManagerPolicy.WindowState paramWindowState, KeyEvent paramKeyEvent, int paramInt)
  1152.   {
  1153.     KeyCharacterMap localKeyCharacterMap1;
  1154.     int i;
  1155.     int j;
  1156.     int k;
  1157.     Intent localIntent1;
  1158.     if ((paramKeyEvent.getFlags() & 0x400) == 0)
  1159.     {
  1160.       localKeyCharacterMap1 = paramKeyEvent.getKeyCharacterMap();
  1161.       i = paramKeyEvent.getKeyCode();
  1162.       j = paramKeyEvent.getMetaState();
  1163.       if ((paramKeyEvent.getAction() == 0) && (paramKeyEvent.getRepeatCount() == 0))
  1164.       {
  1165.         k = 1;
  1166.         if (k == 0)
  1167.           break label304;
  1168.         if ((0x10000 & j) == 0)
  1169.           break label217;
  1170.         ShortcutManager localShortcutManager1 = this.mShortcutManager;
  1171.         int m = 0xFFF8FFFF & j;
  1172.         ShortcutManager localShortcutManager2 = localShortcutManager1;
  1173.         KeyCharacterMap localKeyCharacterMap2 = localKeyCharacterMap1;
  1174.         int n = i;
  1175.         int i1 = m;
  1176.         localIntent1 = localShortcutManager2.getIntent(localKeyCharacterMap2, n, i1);
  1177.         if (localIntent1 == null)
  1178.           break label217;
  1179.         Intent localIntent2 = localIntent1;
  1180.         int i2 = 268435456;
  1181.         Intent localIntent3 = localIntent2.addFlags(i2);
  1182.       }
  1183.     }
  1184.     while (true)
  1185.     {
  1186.       try
  1187.       {
  1188.         Context localContext = this.mContext;
  1189.         Intent localIntent4 = localIntent1;
  1190.         localContext.startActivity(localIntent4);
  1191.         localObject = null;
  1192.         return localObject;
  1193.         k = 0;
  1194.       }
  1195.       catch (ActivityNotFoundException localActivityNotFoundException1)
  1196.       {
  1197.         StringBuilder localStringBuilder = new StringBuilder().append("Dropping shortcut key combination because the activity to which it is registered was not found: META+");
  1198.         String str1 = KeyEvent.keyCodeToString(i);
  1199.         String str2 = str1;
  1200.         String str3 = "WindowManager";
  1201.         String str4 = str2;
  1202.         ActivityNotFoundException localActivityNotFoundException2 = localActivityNotFoundException1;
  1203.         int i3 = Slog.w(str3, str4, localActivityNotFoundException2);
  1204.         continue;
  1205.       }
  1206.       label217: int i4 = i;
  1207.       int i5 = 61;
  1208.       if (i4 == i5)
  1209.       {
  1210.         int i6 = paramKeyEvent.getModifiers() & 0xFFFFFF3E;
  1211.         int i7 = i6;
  1212.         int i8 = 2;
  1213.         if (!KeyEvent.metaStateHasModifiers(i7, i8))
  1214.         {
  1215.           int i9 = i6;
  1216.           int i10 = 65536;
  1217.           if (!KeyEvent.metaStateHasModifiers(i9, i10));
  1218.         }
  1219.         else
  1220.         {
  1221.           PhoneWindowManager localPhoneWindowManager1 = this;
  1222.           int i11 = i6;
  1223.           int i12 = 0;
  1224.           localPhoneWindowManager1.showOrHideRecentAppsDialog(i11, i12);
  1225.           localObject = null;
  1226.           continue;
  1227.         }
  1228.       }
  1229.       label304: KeyCharacterMap.FallbackAction localFallbackAction1 = this.mFallbackAction;
  1230.       PhoneWindowManager localPhoneWindowManager2 = this;
  1231.       KeyCharacterMap localKeyCharacterMap3 = localKeyCharacterMap1;
  1232.       int i13 = i;
  1233.       int i14 = j;
  1234.       KeyCharacterMap.FallbackAction localFallbackAction2 = localFallbackAction1;
  1235.       if (localPhoneWindowManager2.getFallbackAction(localKeyCharacterMap3, i13, i14, localFallbackAction2))
  1236.       {
  1237.         int i15 = paramKeyEvent.getFlags() | 0x400;
  1238.         long l1 = paramKeyEvent.getDownTime();
  1239.         long l2 = paramKeyEvent.getEventTime();
  1240.         int i16 = paramKeyEvent.getAction();
  1241.         int i17 = this.mFallbackAction.keyCode;
  1242.         int i18 = paramKeyEvent.getRepeatCount();
  1243.         int i19 = this.mFallbackAction.metaState;
  1244.         int i20 = paramKeyEvent.getDeviceId();
  1245.         int i21 = paramKeyEvent.getScanCode();
  1246.         int i22 = paramKeyEvent.getSource();
  1247.         KeyEvent localKeyEvent1 = KeyEvent.obtain(l1, l2, i16, i17, i18, i19, i20, i21, i15, i22, null);
  1248.         PhoneWindowManager localPhoneWindowManager3 = this;
  1249.         KeyEvent localKeyEvent2 = localKeyEvent1;
  1250.         int i23 = paramInt;
  1251.         int i24 = 1;
  1252.         if ((localPhoneWindowManager3.interceptKeyBeforeQueueing(localKeyEvent2, i23, i24) & 0x1) != 0)
  1253.         {
  1254.           PhoneWindowManager localPhoneWindowManager4 = this;
  1255.           WindowManagerPolicy.WindowState localWindowState = paramWindowState;
  1256.           KeyEvent localKeyEvent3 = localKeyEvent1;
  1257.           int i25 = paramInt;
  1258.           if (!localPhoneWindowManager4.interceptKeyBeforeDispatching(localWindowState, localKeyEvent3, i25))
  1259.           {
  1260.             localObject = localKeyEvent1;
  1261.             continue;
  1262.           }
  1263.         }
  1264.         localKeyEvent1.recycle();
  1265.       }
  1266.       Object localObject = null;
  1267.     }
  1268.   }
  1269.  
  1270.   public boolean doesForceHide(WindowManagerPolicy.WindowState paramWindowState, WindowManager.LayoutParams paramLayoutParams)
  1271.   {
  1272.     if (paramLayoutParams.type == 2004);
  1273.     for (int i = 1; ; i = 0)
  1274.       return i;
  1275.   }
  1276.  
  1277.   public void dump(String paramString, FileDescriptor paramFileDescriptor, PrintWriter paramPrintWriter, String[] paramArrayOfString)
  1278.   {
  1279.     paramPrintWriter.print(paramString);
  1280.     paramPrintWriter.print("mSafeMode=");
  1281.     boolean bool1 = this.mSafeMode;
  1282.     paramPrintWriter.print(bool1);
  1283.     paramPrintWriter.print(" mSystemRead=");
  1284.     boolean bool2 = this.mSystemReady;
  1285.     paramPrintWriter.println(bool2);
  1286.     paramPrintWriter.print(paramString);
  1287.     paramPrintWriter.print("mLidOpen=");
  1288.     int i = this.mLidOpen;
  1289.     paramPrintWriter.print(i);
  1290.     paramPrintWriter.print(" mLidOpenRotation=");
  1291.     int j = this.mLidOpenRotation;
  1292.     paramPrintWriter.print(j);
  1293.     paramPrintWriter.print(" mHdmiPlugged=");
  1294.     boolean bool3 = this.mHdmiPlugged;
  1295.     paramPrintWriter.println(bool3);
  1296.     paramPrintWriter.print(paramString);
  1297.     paramPrintWriter.print("mUiMode=");
  1298.     int k = this.mUiMode;
  1299.     paramPrintWriter.print(k);
  1300.     paramPrintWriter.print(" mDockMode=");
  1301.     int m = this.mDockMode;
  1302.     paramPrintWriter.print(m);
  1303.     paramPrintWriter.print(" mCarDockRotation=");
  1304.     int n = this.mCarDockRotation;
  1305.     paramPrintWriter.print(n);
  1306.     paramPrintWriter.print(" mDeskDockRotation=");
  1307.     int i1 = this.mDeskDockRotation;
  1308.     paramPrintWriter.println(i1);
  1309.     paramPrintWriter.print(paramString);
  1310.     paramPrintWriter.print("mUserRotationMode=");
  1311.     int i2 = this.mUserRotationMode;
  1312.     paramPrintWriter.print(i2);
  1313.     paramPrintWriter.print(" mUserRotation=");
  1314.     int i3 = this.mUserRotation;
  1315.     paramPrintWriter.print(i3);
  1316.     paramPrintWriter.print(" mAllowAllRotations=");
  1317.     boolean bool4 = this.mAllowAllRotations;
  1318.     paramPrintWriter.println(bool4);
  1319.     paramPrintWriter.print(paramString);
  1320.     paramPrintWriter.print("mAccelerometerDefault=");
  1321.     int i4 = this.mAccelerometerDefault;
  1322.     paramPrintWriter.print(i4);
  1323.     paramPrintWriter.print(" mCurrentAppOrientation=");
  1324.     int i5 = this.mCurrentAppOrientation;
  1325.     paramPrintWriter.println(i5);
  1326.     paramPrintWriter.print(paramString);
  1327.     paramPrintWriter.print("mCarDockEnablesAccelerometer=");
  1328.     boolean bool5 = this.mCarDockEnablesAccelerometer;
  1329.     paramPrintWriter.print(bool5);
  1330.     paramPrintWriter.print(" mDeskDockEnablesAccelerometer=");
  1331.     boolean bool6 = this.mDeskDockEnablesAccelerometer;
  1332.     paramPrintWriter.println(bool6);
  1333.     paramPrintWriter.print(paramString);
  1334.     paramPrintWriter.print("mLidKeyboardAccessibility=");
  1335.     int i6 = this.mLidKeyboardAccessibility;
  1336.     paramPrintWriter.print(i6);
  1337.     paramPrintWriter.print(" mLidNavigationAccessibility=");
  1338.     int i7 = this.mLidNavigationAccessibility;
  1339.     paramPrintWriter.print(i7);
  1340.     paramPrintWriter.print(" mLongPressOnPowerBehavior=");
  1341.     int i8 = this.mLongPressOnPowerBehavior;
  1342.     paramPrintWriter.println(i8);
  1343.     paramPrintWriter.print(paramString);
  1344.     paramPrintWriter.print("mScreenOn=");
  1345.     boolean bool7 = this.mScreenOn;
  1346.     paramPrintWriter.print(bool7);
  1347.     paramPrintWriter.print(" mOrientationSensorEnabled=");
  1348.     boolean bool8 = this.mOrientationSensorEnabled;
  1349.     paramPrintWriter.print(bool8);
  1350.     paramPrintWriter.print(" mHasSoftInput=");
  1351.     boolean bool9 = this.mHasSoftInput;
  1352.     paramPrintWriter.println(bool9);
  1353.     paramPrintWriter.print(paramString);
  1354.     paramPrintWriter.print("mUnrestrictedScreen=(");
  1355.     int i9 = this.mUnrestrictedScreenLeft;
  1356.     paramPrintWriter.print(i9);
  1357.     paramPrintWriter.print(",");
  1358.     int i10 = this.mUnrestrictedScreenTop;
  1359.     paramPrintWriter.print(i10);
  1360.     paramPrintWriter.print(") ");
  1361.     int i11 = this.mUnrestrictedScreenWidth;
  1362.     paramPrintWriter.print(i11);
  1363.     paramPrintWriter.print("x");
  1364.     int i12 = this.mUnrestrictedScreenHeight;
  1365.     paramPrintWriter.println(i12);
  1366.     paramPrintWriter.print(paramString);
  1367.     paramPrintWriter.print("mRestrictedScreen=(");
  1368.     int i13 = this.mRestrictedScreenLeft;
  1369.     paramPrintWriter.print(i13);
  1370.     paramPrintWriter.print(",");
  1371.     int i14 = this.mRestrictedScreenTop;
  1372.     paramPrintWriter.print(i14);
  1373.     paramPrintWriter.print(") ");
  1374.     int i15 = this.mRestrictedScreenWidth;
  1375.     paramPrintWriter.print(i15);
  1376.     paramPrintWriter.print("x");
  1377.     int i16 = this.mRestrictedScreenHeight;
  1378.     paramPrintWriter.println(i16);
  1379.     paramPrintWriter.print(paramString);
  1380.     paramPrintWriter.print("mCur=(");
  1381.     int i17 = this.mCurLeft;
  1382.     paramPrintWriter.print(i17);
  1383.     paramPrintWriter.print(",");
  1384.     int i18 = this.mCurTop;
  1385.     paramPrintWriter.print(i18);
  1386.     paramPrintWriter.print(")-(");
  1387.     int i19 = this.mCurRight;
  1388.     paramPrintWriter.print(i19);
  1389.     paramPrintWriter.print(",");
  1390.     int i20 = this.mCurBottom;
  1391.     paramPrintWriter.print(i20);
  1392.     paramPrintWriter.println(")");
  1393.     paramPrintWriter.print(paramString);
  1394.     paramPrintWriter.print("mContent=(");
  1395.     int i21 = this.mContentLeft;
  1396.     paramPrintWriter.print(i21);
  1397.     paramPrintWriter.print(",");
  1398.     int i22 = this.mContentTop;
  1399.     paramPrintWriter.print(i22);
  1400.     paramPrintWriter.print(")-(");
  1401.     int i23 = this.mContentRight;
  1402.     paramPrintWriter.print(i23);
  1403.     paramPrintWriter.print(",");
  1404.     int i24 = this.mContentBottom;
  1405.     paramPrintWriter.print(i24);
  1406.     paramPrintWriter.println(")");
  1407.     paramPrintWriter.print(paramString);
  1408.     paramPrintWriter.print("mDock=(");
  1409.     int i25 = this.mDockLeft;
  1410.     paramPrintWriter.print(i25);
  1411.     paramPrintWriter.print(",");
  1412.     int i26 = this.mDockTop;
  1413.     paramPrintWriter.print(i26);
  1414.     paramPrintWriter.print(")-(");
  1415.     int i27 = this.mDockRight;
  1416.     paramPrintWriter.print(i27);
  1417.     paramPrintWriter.print(",");
  1418.     int i28 = this.mDockBottom;
  1419.     paramPrintWriter.print(i28);
  1420.     paramPrintWriter.println(")");
  1421.     paramPrintWriter.print(paramString);
  1422.     paramPrintWriter.print("mDockLayer=");
  1423.     int i29 = this.mDockLayer;
  1424.     paramPrintWriter.println(i29);
  1425.     paramPrintWriter.print(paramString);
  1426.     paramPrintWriter.print("mTopFullscreenOpaqueWindowState=");
  1427.     WindowManagerPolicy.WindowState localWindowState = this.mTopFullscreenOpaqueWindowState;
  1428.     paramPrintWriter.println(localWindowState);
  1429.     paramPrintWriter.print(paramString);
  1430.     paramPrintWriter.print("mTopIsFullscreen=");
  1431.     boolean bool10 = this.mTopIsFullscreen;
  1432.     paramPrintWriter.print(bool10);
  1433.     paramPrintWriter.print(" mForceStatusBar=");
  1434.     boolean bool11 = this.mForceStatusBar;
  1435.     paramPrintWriter.print(bool11);
  1436.     paramPrintWriter.print(" mHideLockScreen=");
  1437.     boolean bool12 = this.mHideLockScreen;
  1438.     paramPrintWriter.println(bool12);
  1439.     paramPrintWriter.print(paramString);
  1440.     paramPrintWriter.print("mDismissKeyguard=");
  1441.     boolean bool13 = this.mDismissKeyguard;
  1442.     paramPrintWriter.print(bool13);
  1443.     paramPrintWriter.print(" mHomePressed=");
  1444.     boolean bool14 = this.mHomePressed;
  1445.     paramPrintWriter.println(bool14);
  1446.     paramPrintWriter.print(paramString);
  1447.     paramPrintWriter.print("mAllowLockscreenWhenOn=");
  1448.     boolean bool15 = this.mAllowLockscreenWhenOn;
  1449.     paramPrintWriter.print(bool15);
  1450.     paramPrintWriter.print(" mLockScreenTimeout=");
  1451.     int i30 = this.mLockScreenTimeout;
  1452.     paramPrintWriter.print(i30);
  1453.     paramPrintWriter.print(" mLockScreenTimerActive=");
  1454.     boolean bool16 = this.mLockScreenTimerActive;
  1455.     paramPrintWriter.println(bool16);
  1456.     paramPrintWriter.print(paramString);
  1457.     paramPrintWriter.print("mEndcallBehavior=");
  1458.     int i31 = this.mEndcallBehavior;
  1459.     paramPrintWriter.print(i31);
  1460.     paramPrintWriter.print(" mIncallPowerBehavior=");
  1461.     int i32 = this.mIncallPowerBehavior;
  1462.     paramPrintWriter.print(i32);
  1463.     paramPrintWriter.print(" mLongPressOnHomeBehavior=");
  1464.     int i33 = this.mLongPressOnHomeBehavior;
  1465.     paramPrintWriter.println(i33);
  1466.     paramPrintWriter.print(paramString);
  1467.     paramPrintWriter.print("mLandscapeRotation=");
  1468.     int i34 = this.mLandscapeRotation;
  1469.     paramPrintWriter.print(i34);
  1470.     paramPrintWriter.print(" mSeascapeRotation=");
  1471.     int i35 = this.mSeascapeRotation;
  1472.     paramPrintWriter.println(i35);
  1473.     paramPrintWriter.print(paramString);
  1474.     paramPrintWriter.print("mPortraitRotation=");
  1475.     int i36 = this.mPortraitRotation;
  1476.     paramPrintWriter.print(i36);
  1477.     paramPrintWriter.print(" mUpsideDownRotation=");
  1478.     int i37 = this.mUpsideDownRotation;
  1479.     paramPrintWriter.println(i37);
  1480.   }
  1481.  
  1482.   public void enableKeyguard(boolean paramBoolean)
  1483.   {
  1484.     this.mKeyguardMediator.setKeyguardEnabled(paramBoolean);
  1485.   }
  1486.  
  1487.   public void enableScreenAfterBoot()
  1488.   {
  1489.     readLidState();
  1490.     updateRotation(1);
  1491.   }
  1492.  
  1493.   public void exitKeyguardSecurely(WindowManagerPolicy.OnKeyguardExitResult paramOnKeyguardExitResult)
  1494.   {
  1495.     this.mKeyguardMediator.verifyUnlock(paramOnKeyguardExitResult);
  1496.   }
  1497.  
  1498.   public int finishAnimationLw()
  1499.   {
  1500.     int i = 0;
  1501.     int j = 0;
  1502.     WindowManager.LayoutParams localLayoutParams;
  1503.     if (this.mTopFullscreenOpaqueWindowState != null)
  1504.     {
  1505.       localLayoutParams = this.mTopFullscreenOpaqueWindowState.getAttrs();
  1506.       if (this.mStatusBar != null)
  1507.       {
  1508.         if (!this.mForceStatusBar)
  1509.           break label240;
  1510.         if (this.mStatusBar.showLw(1))
  1511.           i = 0x0 | 0x1;
  1512.       }
  1513.       label54: this.mTopIsFullscreen = j;
  1514.       if (this.mTopAppWindowState != null)
  1515.       {
  1516.         WindowManagerPolicy.WindowState localWindowState1 = this.mTopAppWindowState;
  1517.         WindowManagerPolicy.WindowState localWindowState2 = this.mLastTopAppWindowState;
  1518.         if (localWindowState1 != localWindowState2)
  1519.         {
  1520.           WindowManagerPolicy.WindowState localWindowState3 = this.mTopAppWindowState;
  1521.           this.mLastTopAppWindowState = localWindowState3;
  1522.           if ((this.mTopAppWindowState.getAttrs().flags & 0x8000000) == 0)
  1523.             break label320;
  1524.           int k = 1;
  1525.           label120: Handler localHandler1 = this.mHandler;
  1526.           PhoneWindowManager.7 local7 = new PhoneWindowManager.7(this, k);
  1527.           boolean bool1 = localHandler1.post(local7);
  1528.         }
  1529.       }
  1530.       if (this.mKeyguard != null)
  1531.       {
  1532.         if ((!this.mDismissKeyguard) || (this.mKeyguardMediator.isSecure()))
  1533.           break label327;
  1534.         if (this.mKeyguard.hideLw(1))
  1535.           i |= 7;
  1536.         if (this.mKeyguardMediator.isShowing())
  1537.         {
  1538.           Handler localHandler2 = this.mHandler;
  1539.           PhoneWindowManager.8 local8 = new PhoneWindowManager.8(this);
  1540.           boolean bool2 = localHandler2.post(local8);
  1541.         }
  1542.       }
  1543.     }
  1544.     while (true)
  1545.     {
  1546.       updateSystemUiVisibility();
  1547.       updateLockScreenTimeout();
  1548.       return i;
  1549.       localLayoutParams = null;
  1550.       break;
  1551.       label240: if (this.mTopFullscreenOpaqueWindowState == null)
  1552.         break label54;
  1553.       if ((localLayoutParams.flags & 0x400) != 0);
  1554.       for (j = 1; ; j = 0)
  1555.       {
  1556.         if (j == 0)
  1557.           break label299;
  1558.         if ((!this.mStatusBarCanHide) || (!this.mStatusBar.hideLw(1)))
  1559.           break;
  1560.         i = 0x0 | 0x1;
  1561.         break;
  1562.       }
  1563.       label299: if (!this.mStatusBar.showLw(1))
  1564.         break label54;
  1565.       i = 0x0 | 0x1;
  1566.       break label54;
  1567.       label320: int m = 0;
  1568.       break label120;
  1569.       label327: if (this.mHideLockScreen)
  1570.       {
  1571.         if (this.mKeyguard.hideLw(1))
  1572.           i |= 7;
  1573.         this.mKeyguardMediator.setHidden(1);
  1574.         continue;
  1575.       }
  1576.       if (this.mKeyguard.showLw(1))
  1577.         i |= 7;
  1578.       this.mKeyguardMediator.setHidden(0);
  1579.     }
  1580.   }
  1581.  
  1582.   public int finishLayoutLw()
  1583.   {
  1584.     return 0;
  1585.   }
  1586.  
  1587.   public void focusChanged(WindowManagerPolicy.WindowState paramWindowState1, WindowManagerPolicy.WindowState paramWindowState2)
  1588.   {
  1589.     this.mFocusedWindow = paramWindowState2;
  1590.     updateSystemUiVisibility();
  1591.   }
  1592.  
  1593.   public int getConfigDisplayHeight(int paramInt1, int paramInt2)
  1594.   {
  1595.     int i = this.mStatusBarHeight;
  1596.     return paramInt2 - i;
  1597.   }
  1598.  
  1599.   public int getConfigDisplayWidth(int paramInt1, int paramInt2)
  1600.   {
  1601.     return paramInt2;
  1602.   }
  1603.  
  1604.   public void getContentInsetHintLw(WindowManager.LayoutParams paramLayoutParams, Rect paramRect)
  1605.   {
  1606.     int i = paramLayoutParams.flags;
  1607.     if ((0x10500 & i) == 65792)
  1608.     {
  1609.       int j = this.mCurLeft;
  1610.       int k = this.mCurTop;
  1611.       int m = this.mRestrictedScreenLeft;
  1612.       int n = this.mRestrictedScreenWidth;
  1613.       int i1 = m + n;
  1614.       int i2 = this.mCurRight;
  1615.       int i3 = i1 - i2;
  1616.       int i4 = this.mRestrictedScreenTop;
  1617.       int i5 = this.mRestrictedScreenHeight;
  1618.       int i6 = i4 + i5;
  1619.       int i7 = this.mCurBottom;
  1620.       int i8 = i6 - i7;
  1621.       paramRect.set(j, k, i3, i8);
  1622.       return;
  1623.     }
  1624.     paramRect.setEmpty();
  1625.   }
  1626.  
  1627.   public int getLockedRotationLw()
  1628.   {
  1629.     synchronized (this.mLock)
  1630.     {
  1631.       return -1;
  1632.     }
  1633.   }
  1634.  
  1635.   public int getMaxWallpaperLayer()
  1636.   {
  1637.     return 8;
  1638.   }
  1639.  
  1640.   public int getNonDecorDisplayHeight(int paramInt1, int paramInt2)
  1641.   {
  1642.     if (this.mStatusBarCanHide);
  1643.     int j;
  1644.     for (int i = paramInt2; ; i = paramInt2 - j)
  1645.     {
  1646.       return i;
  1647.       j = this.mStatusBarHeight;
  1648.     }
  1649.   }
  1650.  
  1651.   public int getNonDecorDisplayWidth(int paramInt1, int paramInt2)
  1652.   {
  1653.     return paramInt2;
  1654.   }
  1655.  
  1656.   boolean goHome()
  1657.   {
  1658.     try
  1659.     {
  1660.       if (SystemProperties.getInt("persist.sys.uts-test-mode", 0) == 1)
  1661.       {
  1662.         int i = Log.d("WindowManager", "UTS-TEST-MODE");
  1663.         IActivityManager localIActivityManager1 = ActivityManagerNative.getDefault();
  1664.         Intent localIntent1 = this.mHomeIntent;
  1665.         Intent localIntent2 = this.mHomeIntent;
  1666.         ContentResolver localContentResolver1 = this.mContext.getContentResolver();
  1667.         String str1 = localIntent2.resolveTypeIfNeeded(localContentResolver1);
  1668.         if (localIActivityManager1.startActivity(null, localIntent1, str1, null, 0, null, null, 0, 1, 0) != 1);
  1669.       }
  1670.       else
  1671.       {
  1672.         for (j = 0; ; j = 0)
  1673.         {
  1674.           return j;
  1675.           ActivityManagerNative.getDefault().stopAppSwitches();
  1676.           sendCloseSystemWindows();
  1677.           Intent localIntent3 = createHomeDockIntent();
  1678.           if (localIntent3 == null)
  1679.             break;
  1680.           IActivityManager localIActivityManager2 = ActivityManagerNative.getDefault();
  1681.           ContentResolver localContentResolver2 = this.mContext.getContentResolver();
  1682.           String str2 = localIntent3.resolveTypeIfNeeded(localContentResolver2);
  1683.           int k = localIActivityManager2.startActivity(null, localIntent3, str2, null, 0, null, null, 0, 1, 0);
  1684.           if (k != 1)
  1685.             break;
  1686.         }
  1687.       }
  1688.     }
  1689.     catch (RemoteException localRemoteException)
  1690.     {
  1691.       while (true)
  1692.         int j = 1;
  1693.     }
  1694.   }
  1695.  
  1696.   void handleVolumeKey(int paramInt1, int paramInt2)
  1697.   {
  1698.     IAudioService localIAudioService = getAudioService();
  1699.     if (localIAudioService == null)
  1700.       return;
  1701.     try
  1702.     {
  1703.       this.mBroadcastWakeLock.acquire();
  1704.       if (paramInt2 == 24);
  1705.       for (int i = 1; ; i = -1)
  1706.       {
  1707.         localIAudioService.adjustStreamVolume(paramInt1, i, 0);
  1708.         return;
  1709.       }
  1710.     }
  1711.     catch (RemoteException localRemoteException)
  1712.     {
  1713.       String str = "IAudioService.adjustStreamVolume() threw RemoteException " + localRemoteException;
  1714.       int j = Log.w("WindowManager", str);
  1715.       return;
  1716.     }
  1717.     finally
  1718.     {
  1719.       this.mBroadcastWakeLock.release();
  1720.     }
  1721.     throw localObject;
  1722.   }
  1723.  
  1724.   public boolean inKeyguardRestrictedKeyInputMode()
  1725.   {
  1726.     return this.mKeyguardMediator.isInputRestricted();
  1727.   }
  1728.  
  1729.   public void init(Context paramContext, IWindowManager paramIWindowManager, LocalPowerManager paramLocalPowerManager)
  1730.   {
  1731.     this.mContext = paramContext;
  1732.     this.mWindowManager = paramIWindowManager;
  1733.     this.mPowerManager = paramLocalPowerManager;
  1734.     KeyguardViewMediator localKeyguardViewMediator = new KeyguardViewMediator(paramContext, this, paramLocalPowerManager);
  1735.     this.mKeyguardMediator = localKeyguardViewMediator;
  1736.     Handler localHandler1 = new Handler();
  1737.     this.mHandler = localHandler1;
  1738.     Context localContext = this.mContext;
  1739.     MyOrientationListener localMyOrientationListener = new MyOrientationListener(localContext);
  1740.     this.mOrientationListener = localMyOrientationListener;
  1741.     Handler localHandler2 = this.mHandler;
  1742.     new SettingsObserver(localHandler2).observe();
  1743.     Handler localHandler3 = this.mHandler;
  1744.     ShortcutManager localShortcutManager = new ShortcutManager(paramContext, localHandler3);
  1745.     this.mShortcutManager = localShortcutManager;
  1746.     this.mShortcutManager.observe();
  1747.     Intent localIntent1 = new Intent("android.intent.action.MAIN", null);
  1748.     this.mHomeIntent = localIntent1;
  1749.     Intent localIntent2 = this.mHomeIntent.addCategory("android.intent.category.HOME");
  1750.     Intent localIntent3 = this.mHomeIntent.addFlags(270532608);
  1751.     Intent localIntent4 = new Intent("android.intent.action.MAIN", null);
  1752.     this.mCarDockIntent = localIntent4;
  1753.     Intent localIntent5 = this.mCarDockIntent.addCategory("android.intent.category.CAR_DOCK");
  1754.     Intent localIntent6 = this.mCarDockIntent.addFlags(270532608);
  1755.     Intent localIntent7 = new Intent("android.intent.action.MAIN", null);
  1756.     this.mDeskDockIntent = localIntent7;
  1757.     Intent localIntent8 = this.mDeskDockIntent.addCategory("android.intent.category.DESK_DOCK");
  1758.     Intent localIntent9 = this.mDeskDockIntent.addFlags(270532608);
  1759.     PowerManager.WakeLock localWakeLock = ((PowerManager)paramContext.getSystemService("power")).newWakeLock(1, "PhoneWindowManager.mBroadcastWakeLock");
  1760.     this.mBroadcastWakeLock = localWakeLock;
  1761.     String str1 = SystemProperties.get("ro.debuggable");
  1762.     boolean bool1 = "1".equals(str1);
  1763.     this.mEnableShiftMenuBugReports = bool1;
  1764.     int i = readRotation(17694728);
  1765.     this.mLidOpenRotation = i;
  1766.     int j = readRotation(17694730);
  1767.     this.mCarDockRotation = j;
  1768.     int k = readRotation(17694729);
  1769.     this.mDeskDockRotation = k;
  1770.     boolean bool2 = this.mContext.getResources().getBoolean(17891340);
  1771.     this.mAllowAllRotations = bool2;
  1772.     boolean bool3 = this.mContext.getResources().getBoolean(17891343);
  1773.     this.mCarDockEnablesAccelerometer = bool3;
  1774.     boolean bool4 = this.mContext.getResources().getBoolean(17891342);
  1775.     this.mDeskDockEnablesAccelerometer = bool4;
  1776.     int m = this.mContext.getResources().getInteger(17694733);
  1777.     this.mLidKeyboardAccessibility = m;
  1778.     int n = this.mContext.getResources().getInteger(17694734);
  1779.     this.mLidNavigationAccessibility = n;
  1780.     IntentFilter localIntentFilter = new IntentFilter();
  1781.     String str2 = UiModeManager.ACTION_ENTER_CAR_MODE;
  1782.     localIntentFilter.addAction(str2);
  1783.     String str3 = UiModeManager.ACTION_EXIT_CAR_MODE;
  1784.     localIntentFilter.addAction(str3);
  1785.     String str4 = UiModeManager.ACTION_ENTER_DESK_MODE;
  1786.     localIntentFilter.addAction(str4);
  1787.     String str5 = UiModeManager.ACTION_EXIT_DESK_MODE;
  1788.     localIntentFilter.addAction(str5);
  1789.     localIntentFilter.addAction("android.intent.action.DOCK_EVENT");
  1790.     BroadcastReceiver localBroadcastReceiver = this.mDockReceiver;
  1791.     Intent localIntent10 = paramContext.registerReceiver(localBroadcastReceiver, localIntentFilter);
  1792.     if (localIntent10 != null)
  1793.     {
  1794.       int i1 = localIntent10.getIntExtra("android.intent.extra.DOCK_STATE", 0);
  1795.       this.mDockMode = i1;
  1796.     }
  1797.     Vibrator localVibrator = new Vibrator();
  1798.     this.mVibrator = localVibrator;
  1799.     long[] arrayOfLong1 = getLongIntArray(this.mContext.getResources(), 17235988);
  1800.     this.mLongPressVibePattern = arrayOfLong1;
  1801.     long[] arrayOfLong2 = getLongIntArray(this.mContext.getResources(), 17235989);
  1802.     this.mVirtualKeyVibePattern = arrayOfLong2;
  1803.     long[] arrayOfLong3 = getLongIntArray(this.mContext.getResources(), 17235990);
  1804.     this.mKeyboardTapVibePattern = arrayOfLong3;
  1805.     long[] arrayOfLong4 = getLongIntArray(this.mContext.getResources(), 17235991);
  1806.     this.mSafeModeDisabledVibePattern = arrayOfLong4;
  1807.     long[] arrayOfLong5 = getLongIntArray(this.mContext.getResources(), 17235992);
  1808.     this.mSafeModeEnabledVibePattern = arrayOfLong5;
  1809.     if (new File("/sys/devices/virtual/switch/hdmi/state").exists())
  1810.       this.mHDMIObserver.startObserving("DEVPATH=/devices/virtual/switch/hdmi");
  1811.     int i2;
  1812.     if (!readHdmiState())
  1813.     {
  1814.       i2 = 1;
  1815.       this.mHdmiPlugged = i2;
  1816.       if (this.mHdmiPlugged)
  1817.         break label741;
  1818.     }
  1819.     label741: int i4;
  1820.     for (int i3 = 1; ; i4 = 0)
  1821.     {
  1822.       setHdmiPlugged(i3);
  1823.       return;
  1824.       i2 = 0;
  1825.       break;
  1826.     }
  1827.   }
  1828.  
  1829.   public boolean interceptKeyBeforeDispatching(WindowManagerPolicy.WindowState paramWindowState, KeyEvent paramKeyEvent, int paramInt)
  1830.   {
  1831.     boolean bool1 = keyguardOn();
  1832.     int i = paramKeyEvent.getKeyCode();
  1833.     int j = paramKeyEvent.getRepeatCount();
  1834.     int k = paramKeyEvent.getMetaState();
  1835.     int m;
  1836.     int i3;
  1837.     if (paramKeyEvent.getAction() == 0)
  1838.     {
  1839.       m = 1;
  1840.       boolean bool2 = paramKeyEvent.isCanceled();
  1841.       int n = i;
  1842.       int i1 = 3;
  1843.       if (n != i1)
  1844.         break label397;
  1845.       if (m == 0)
  1846.       {
  1847.         Handler localHandler1 = this.mHandler;
  1848.         Runnable localRunnable1 = this.mHomeLongPress;
  1849.         localHandler1.removeCallbacks(localRunnable1);
  1850.       }
  1851.       if ((!this.mHomePressed) || (m != 0))
  1852.         break label208;
  1853.       int i2 = 0;
  1854.       this.mHomePressed = i2;
  1855.       if (bool2)
  1856.         break label195;
  1857.       i3 = 0;
  1858.     }
  1859.     while (true)
  1860.     {
  1861.       try
  1862.       {
  1863.         ITelephony localITelephony = getTelephonyService();
  1864.         if (localITelephony == null)
  1865.           continue;
  1866.         int i4 = localITelephony.isRinging();
  1867.         i3 = i4;
  1868.         if (i3 == 0)
  1869.           continue;
  1870.         int i5 = Log.i("WindowManager", "Ignoring HOME; there's a ringing incoming call.");
  1871.         i6 = 1;
  1872.         return i6;
  1873.         m = 0;
  1874.       }
  1875.       catch (RemoteException localRemoteException1)
  1876.       {
  1877.         String str1 = "WindowManager";
  1878.         String str2 = "RemoteException from getPhoneInterface()";
  1879.         RemoteException localRemoteException2 = localRemoteException1;
  1880.         int i7 = Log.w(str1, str2, localRemoteException2);
  1881.         continue;
  1882.         launchHomeFromHotKey();
  1883.         continue;
  1884.       }
  1885.       label195: int i8 = Log.i("WindowManager", "Ignoring HOME; event canceled.");
  1886.       continue;
  1887.       label208: if (paramWindowState != null);
  1888.       int i9;
  1889.       for (WindowManager.LayoutParams localLayoutParams = paramWindowState.getAttrs(); ; localLayoutParams = null)
  1890.       {
  1891.         if (localLayoutParams == null)
  1892.           break label338;
  1893.         i9 = localLayoutParams.type;
  1894.         int i10 = i9;
  1895.         int i11 = 2004;
  1896.         if (i10 != i11)
  1897.         {
  1898.           int i12 = i9;
  1899.           int i13 = 2009;
  1900.           if (i12 != i13)
  1901.             break label276;
  1902.         }
  1903.         i6 = 0;
  1904.         break;
  1905.       }
  1906.       label276: int i14 = WINDOW_TYPES_WHERE_HOME_DOESNT_WORK.length;
  1907.       int i15 = 0;
  1908.       while (true)
  1909.       {
  1910.         int i16 = i15;
  1911.         int i17 = i14;
  1912.         if (i16 >= i17)
  1913.           break label338;
  1914.         int i18 = WINDOW_TYPES_WHERE_HOME_DOESNT_WORK[i15];
  1915.         int i19 = i9;
  1916.         int i20 = i18;
  1917.         if (i19 == i20)
  1918.         {
  1919.           i6 = 1;
  1920.           break;
  1921.         }
  1922.         i15 += 1;
  1923.       }
  1924.       label338: if ((m != 0) && (j == 0))
  1925.       {
  1926.         if (!bool1)
  1927.         {
  1928.           Handler localHandler2 = this.mHandler;
  1929.           Runnable localRunnable2 = this.mHomeLongPress;
  1930.           long l = ViewConfiguration.getGlobalActionKeyTimeout();
  1931.           boolean bool3 = localHandler2.postDelayed(localRunnable2, l);
  1932.         }
  1933.         int i21 = 1;
  1934.         this.mHomePressed = i21;
  1935.       }
  1936.       int i6 = 1;
  1937.       continue;
  1938.       label397: int i22 = i;
  1939.       int i23 = 82;
  1940.       if (i22 == i23)
  1941.       {
  1942.         if ((m != 0) && (j == 0) && (this.mEnableShiftMenuBugReports))
  1943.         {
  1944.           int i24 = k & 0x1;
  1945.           int i25 = 1;
  1946.           if (i24 == i25)
  1947.           {
  1948.             Intent localIntent1 = new android/content/Intent;
  1949.             Intent localIntent2 = localIntent1;
  1950.             String str3 = "android.intent.action.BUG_REPORT";
  1951.             localIntent2.<init>(str3);
  1952.             Context localContext1 = this.mContext;
  1953.             Intent localIntent3 = localIntent1;
  1954.             String str4 = null;
  1955.             localContext1.sendOrderedBroadcast(localIntent3, str4);
  1956.             i6 = 1;
  1957.             continue;
  1958.           }
  1959.         }
  1960.       }
  1961.       else
  1962.       {
  1963.         int i26 = i;
  1964.         int i27 = 84;
  1965.         if (i26 == i27)
  1966.         {
  1967.           if (m != 0)
  1968.             if (j == 0)
  1969.             {
  1970.               int i28 = i;
  1971.               this.mShortcutKeyPressed = i28;
  1972.               int i29 = 0;
  1973.               this.mConsumeShortcutKeyUp = i29;
  1974.             }
  1975.           do
  1976.           {
  1977.             int i31;
  1978.             int i32;
  1979.             do
  1980.             {
  1981.               i6 = 0;
  1982.               break;
  1983.               int i30 = this.mShortcutKeyPressed;
  1984.               i31 = i;
  1985.               i32 = i30;
  1986.             }
  1987.             while (i31 != i32);
  1988.             int i33 = 65535;
  1989.             this.mShortcutKeyPressed = i33;
  1990.           }
  1991.           while (!this.mConsumeShortcutKeyUp);
  1992.           int i34 = 0;
  1993.           this.mConsumeShortcutKeyUp = i34;
  1994.           i6 = 1;
  1995.           continue;
  1996.         }
  1997.         int i35 = i;
  1998.         int i36 = 187;
  1999.         if (i35 == i36)
  2000.         {
  2001.           if ((m != 0) && (j == 0))
  2002.           {
  2003.             PhoneWindowManager localPhoneWindowManager = this;
  2004.             int i37 = 0;
  2005.             int i38 = 1;
  2006.             localPhoneWindowManager.showOrHideRecentAppsDialog(i37, i38);
  2007.           }
  2008.           i6 = 1;
  2009.           continue;
  2010.         }
  2011.       }
  2012.       int i39 = this.mShortcutKeyPressed;
  2013.       int i40 = 65535;
  2014.       if (i39 != i40)
  2015.       {
  2016.         KeyCharacterMap localKeyCharacterMap1 = paramKeyEvent.getKeyCharacterMap();
  2017.         if (localKeyCharacterMap1.isPrintingKey(i))
  2018.         {
  2019.           int i41 = 1;
  2020.           this.mConsumeShortcutKeyUp = i41;
  2021.           Intent localIntent4;
  2022.           if ((m != 0) && (j == 0) && (!bool1))
  2023.           {
  2024.             ShortcutManager localShortcutManager = this.mShortcutManager;
  2025.             KeyCharacterMap localKeyCharacterMap2 = localKeyCharacterMap1;
  2026.             int i42 = i;
  2027.             int i43 = k;
  2028.             localIntent4 = localShortcutManager.getIntent(localKeyCharacterMap2, i42, i43);
  2029.             if (localIntent4 == null)
  2030.               break label873;
  2031.             Intent localIntent5 = localIntent4;
  2032.             int i44 = 268435456;
  2033.             Intent localIntent6 = localIntent5.addFlags(i44);
  2034.           }
  2035.           while (true)
  2036.           {
  2037.             try
  2038.             {
  2039.               Context localContext2 = this.mContext;
  2040.               Intent localIntent7 = localIntent4;
  2041.               localContext2.startActivity(localIntent7);
  2042.               i6 = 1;
  2043.             }
  2044.             catch (ActivityNotFoundException localActivityNotFoundException1)
  2045.             {
  2046.               StringBuilder localStringBuilder1 = new StringBuilder().append("Dropping shortcut key combination because the activity to which it is registered was not found: ");
  2047.               String str5 = KeyEvent.keyCodeToString(this.mShortcutKeyPressed);
  2048.               StringBuilder localStringBuilder2 = localStringBuilder1.append(str5).append("+");
  2049.               String str6 = KeyEvent.keyCodeToString(i);
  2050.               String str7 = str6;
  2051.               String str8 = "WindowManager";
  2052.               String str9 = str7;
  2053.               ActivityNotFoundException localActivityNotFoundException2 = localActivityNotFoundException1;
  2054.               int i45 = Slog.w(str8, str9, localActivityNotFoundException2);
  2055.               continue;
  2056.             }
  2057.             label873: StringBuilder localStringBuilder3 = new StringBuilder().append("Dropping unregistered shortcut key combination: ");
  2058.             String str10 = KeyEvent.keyCodeToString(this.mShortcutKeyPressed);
  2059.             StringBuilder localStringBuilder4 = localStringBuilder3.append(str10).append("+");
  2060.             String str11 = KeyEvent.keyCodeToString(i);
  2061.             String str12 = str11;
  2062.             int i46 = Slog.i("WindowManager", str12);
  2063.           }
  2064.         }
  2065.       }
  2066.       i6 = 0;
  2067.     }
  2068.   }
  2069.  
  2070.   public int interceptKeyBeforeQueueing(KeyEvent paramKeyEvent, int paramInt, boolean paramBoolean)
  2071.   {
  2072.     int i;
  2073.     boolean bool1;
  2074.     int j;
  2075.     int k;
  2076.     label33: boolean bool2;
  2077.     label46: int m;
  2078.     if (paramKeyEvent.getAction() == 0)
  2079.     {
  2080.       i = 1;
  2081.       bool1 = paramKeyEvent.isCanceled();
  2082.       j = paramKeyEvent.getKeyCode();
  2083.       if ((0x1000000 & paramInt) == 0)
  2084.         break label237;
  2085.       k = 1;
  2086.       if (!paramBoolean)
  2087.         break label243;
  2088.       bool2 = this.mKeyguardMediator.isShowingAndNotHidden();
  2089.       if ((i != 0) && ((paramInt & 0x100) != 0))
  2090.         boolean bool3 = performHapticFeedbackLw(null, 1, 0);
  2091.       if ((!paramBoolean) && (k == 0))
  2092.         break label255;
  2093.       m = 1;
  2094.       label81: switch (j)
  2095.       {
  2096.       default:
  2097.       case 24:
  2098.       case 25:
  2099.       case 164:
  2100.       case 6:
  2101.       case 26:
  2102.       case 85:
  2103.       case 126:
  2104.       case 127:
  2105.       case 79:
  2106.       case 86:
  2107.       case 87:
  2108.       case 88:
  2109.       case 89:
  2110.       case 90:
  2111.       case 91:
  2112.       case 130:
  2113.       case 5:
  2114.       }
  2115.     }
  2116.     while (true)
  2117.     {
  2118.       return m;
  2119.       i = 0;
  2120.       break;
  2121.       label237: k = 0;
  2122.       break label33;
  2123.       label243: bool2 = this.mKeyguardMediator.isShowing();
  2124.       break label46;
  2125.       label255: m = 0;
  2126.       if ((paramInt & 0x3) != 0);
  2127.       for (int n = 1; (i != 0) && (n != 0); n = 0)
  2128.       {
  2129.         if (!bool2)
  2130.           break label302;
  2131.         boolean bool4 = this.mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(j);
  2132.         break;
  2133.       }
  2134.       label302: m |= 2;
  2135.       break label81;
  2136.       if (i == 0)
  2137.         continue;
  2138.       ITelephony localITelephony = getTelephonyService();
  2139.       if (localITelephony != null)
  2140.         try
  2141.         {
  2142.           if (localITelephony.isRinging())
  2143.           {
  2144.             int i1 = Log.i("WindowManager", "interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!");
  2145.             localITelephony.silenceRinger();
  2146.             m &= -2;
  2147.             continue;
  2148.           }
  2149.           if ((localITelephony.isOffhook()) && ((m & 0x1) == 0))
  2150.             handleVolumeKey(0, j);
  2151.         }
  2152.         catch (RemoteException localRemoteException1)
  2153.         {
  2154.           int i2 = Log.w("WindowManager", "ITelephony threw RemoteException", localRemoteException1);
  2155.         }
  2156.       if ((!isMusicActive()) || ((m & 0x1) != 0))
  2157.         continue;
  2158.       handleVolumeKey(3, j);
  2159.       continue;
  2160.       m &= -2;
  2161.       int i3;
  2162.       int i6;
  2163.       if (i != 0)
  2164.       {
  2165.         localITelephony = getTelephonyService();
  2166.         i3 = 0;
  2167.         if (localITelephony != null);
  2168.         try
  2169.         {
  2170.           int i4 = localITelephony.endCall();
  2171.           i3 = i4;
  2172.           if ((!paramBoolean) || (i3 != 0))
  2173.           {
  2174.             int i5 = 1;
  2175.             interceptPowerKeyDown(i5);
  2176.           }
  2177.         }
  2178.         catch (RemoteException localRemoteException2)
  2179.         {
  2180.           while (true)
  2181.           {
  2182.             int i8 = Log.w("WindowManager", "ITelephony threw RemoteException", localRemoteException2);
  2183.             continue;
  2184.             i6 = 0;
  2185.           }
  2186.         }
  2187.       }
  2188.       if ((!interceptPowerKeyUp(bool1)) || (((this.mEndcallBehavior & 0x1) != 0) && (goHome())) || ((this.mEndcallBehavior & 0x2) == 0))
  2189.         continue;
  2190.       m = m & 0xFFFFFFFD | 0x4;
  2191.       continue;
  2192.       m &= -2;
  2193.       int i9;
  2194.       if (i != 0)
  2195.       {
  2196.         localITelephony = getTelephonyService();
  2197.         i3 = 0;
  2198.         if (localITelephony != null);
  2199.         try
  2200.         {
  2201.           if (localITelephony.isRinging())
  2202.             localITelephony.silenceRinger();
  2203.           while (true)
  2204.           {
  2205.             if ((paramBoolean) && (i3 == 0))
  2206.               break label676;
  2207.             i6 = 1;
  2208.             interceptPowerKeyDown(i6);
  2209.             break;
  2210.             if (((this.mIncallPowerBehavior & 0x2) == 0) || (!localITelephony.isOffhook()))
  2211.               continue;
  2212.             i9 = localITelephony.endCall();
  2213.             i3 = i9;
  2214.           }
  2215.         }
  2216.         catch (RemoteException localRemoteException3)
  2217.         {
  2218.           while (true)
  2219.           {
  2220.             int i10 = Log.w("WindowManager", "ITelephony threw RemoteException", localRemoteException3);
  2221.             continue;
  2222.             label676: int i7 = 0;
  2223.           }
  2224.         }
  2225.       }
  2226.       if (!interceptPowerKeyUp(bool1))
  2227.         continue;
  2228.       m = m & 0xFFFFFFFD | 0x4;
  2229.       continue;
  2230.       if (i != 0)
  2231.       {
  2232.         localITelephony = getTelephonyService();
  2233.         if (localITelephony == null);
  2234.       }
  2235.       try
  2236.       {
  2237.         i9 = localITelephony.isIdle();
  2238.         if ((i9 == 0) || ((m & 0x1) != 0))
  2239.           continue;
  2240.         this.mBroadcastWakeLock.acquire();
  2241.         Handler localHandler = this.mHandler;
  2242.         KeyEvent localKeyEvent = new KeyEvent(paramKeyEvent);
  2243.         PassHeadsetKey localPassHeadsetKey = new PassHeadsetKey(localKeyEvent);
  2244.         boolean bool5 = localHandler.post(localPassHeadsetKey);
  2245.       }
  2246.       catch (RemoteException localRemoteException4)
  2247.       {
  2248.         while (true)
  2249.           int i11 = Log.w("WindowManager", "ITelephony threw RemoteException", localRemoteException4);
  2250.       }
  2251.       if (i == 0)
  2252.         continue;
  2253.       localITelephony = getTelephonyService();
  2254.       if (localITelephony == null)
  2255.         continue;
  2256.       try
  2257.       {
  2258.         if (!localITelephony.isRinging())
  2259.           continue;
  2260.         int i12 = Log.i("WindowManager", "interceptKeyBeforeQueueing: CALL key-down while ringing: Answer the call!");
  2261.         localITelephony.answerRingingCall();
  2262.         m &= -2;
  2263.       }
  2264.       catch (RemoteException localRemoteException5)
  2265.       {
  2266.         int i13 = Log.w("WindowManager", "ITelephony threw RemoteException", localRemoteException5);
  2267.       }
  2268.     }
  2269.   }
  2270.  
  2271.   public int interceptMotionBeforeQueueingWhenScreenOff(int paramInt)
  2272.   {
  2273.     int i = 0;
  2274.     int j;
  2275.     if ((paramInt & 0x3) != 0)
  2276.     {
  2277.       j = 1;
  2278.       if (j != 0)
  2279.       {
  2280.         if (!this.mKeyguardMediator.isShowing())
  2281.           break label40;
  2282.         boolean bool = this.mKeyguardMediator.onWakeMotionWhenKeyguardShowingTq();
  2283.       }
  2284.     }
  2285.     while (true)
  2286.     {
  2287.       return i;
  2288.       j = 0;
  2289.       break;
  2290.       label40: i = 0x0 | 0x2;
  2291.     }
  2292.   }
  2293.  
  2294.   boolean isDeviceProvisioned()
  2295.   {
  2296.     if (Settings.Secure.getInt(this.mContext.getContentResolver(), "device_provisioned", 0) != 0);
  2297.     for (int i = 1; ; i = 0)
  2298.       return i;
  2299.   }
  2300.  
  2301.   public boolean isKeyguardLocked()
  2302.   {
  2303.     return keyguardOn();
  2304.   }
  2305.  
  2306.   public boolean isKeyguardSecure()
  2307.   {
  2308.     return this.mKeyguardMediator.isSecure();
  2309.   }
  2310.  
  2311.   boolean isMusicActive()
  2312.   {
  2313.     AudioManager localAudioManager = (AudioManager)this.mContext.getSystemService("audio");
  2314.     if (localAudioManager == null)
  2315.       int i = Log.w("WindowManager", "isMusicActive: couldn't get AudioManager reference");
  2316.     boolean bool;
  2317.     for (int j = 0; ; bool = localAudioManager.isMusicActive())
  2318.       return j;
  2319.   }
  2320.  
  2321.   public boolean isScreenOn()
  2322.   {
  2323.     return this.mScreenOn;
  2324.   }
  2325.  
  2326.   boolean keyguardOn()
  2327.   {
  2328.     if ((keyguardIsShowingTq()) || (inKeyguardRestrictedKeyInputMode()));
  2329.     for (int i = 1; ; i = 0)
  2330.       return i;
  2331.   }
  2332.  
  2333.   void launchHomeFromHotKey()
  2334.   {
  2335.     if (this.mKeyguardMediator.isShowingAndNotHidden())
  2336.       return;
  2337.     if ((!this.mHideLockScreen) && (this.mKeyguardMediator.isInputRestricted()))
  2338.     {
  2339.       KeyguardViewMediator localKeyguardViewMediator = this.mKeyguardMediator;
  2340.       PhoneWindowManager.6 local6 = new PhoneWindowManager.6(this);
  2341.       localKeyguardViewMediator.verifyUnlock(local6);
  2342.       return;
  2343.     }
  2344.     try
  2345.     {
  2346.       ActivityManagerNative.getDefault().stopAppSwitches();
  2347.       label56: sendCloseSystemWindows("homekey");
  2348.       startDockOrHome();
  2349.       return;
  2350.     }
  2351.     catch (RemoteException localRemoteException)
  2352.     {
  2353.       break label56;
  2354.     }
  2355.   }
  2356.  
  2357.   public void layoutWindowLw(WindowManagerPolicy.WindowState paramWindowState1, WindowManager.LayoutParams paramLayoutParams, WindowManagerPolicy.WindowState paramWindowState2)
  2358.   {
  2359.     WindowManagerPolicy.WindowState localWindowState1 = this.mStatusBar;
  2360.     WindowManagerPolicy.WindowState localWindowState2 = paramWindowState1;
  2361.     WindowManagerPolicy.WindowState localWindowState3 = localWindowState1;
  2362.     if (localWindowState2 == localWindowState3)
  2363.       return;
  2364.     int i = paramLayoutParams.flags;
  2365.     int j = paramLayoutParams.softInputMode;
  2366.     Rect localRect1 = mTmpParentFrame;
  2367.     Rect localRect2 = mTmpDisplayFrame;
  2368.     Rect localRect3 = mTmpContentFrame;
  2369.     Rect localRect4 = mTmpVisibleFrame;
  2370.     if (paramLayoutParams.type == 2011)
  2371.     {
  2372.       int k = this.mDockLeft;
  2373.       localRect4.left = k;
  2374.       localRect3.left = k;
  2375.       localRect2.left = k;
  2376.       localRect1.left = k;
  2377.       int m = this.mDockTop;
  2378.       localRect4.top = m;
  2379.       localRect3.top = m;
  2380.       localRect2.top = m;
  2381.       localRect1.top = m;
  2382.       int n = this.mDockRight;
  2383.       localRect4.right = n;
  2384.       localRect3.right = n;
  2385.       localRect2.right = n;
  2386.       localRect1.right = n;
  2387.       int i1 = this.mDockBottom;
  2388.       localRect4.bottom = i1;
  2389.       localRect3.bottom = i1;
  2390.       localRect2.bottom = i1;
  2391.       localRect1.bottom = i1;
  2392.       int i2 = 80;
  2393.       paramLayoutParams.gravity = i2;
  2394.       int i3 = paramWindowState1.getSurfaceLayer();
  2395.       this.mDockLayer = i3;
  2396.     }
  2397.     while (true)
  2398.     {
  2399.       if ((i & 0x200) != 0)
  2400.       {
  2401.         localRect4.top = 55536;
  2402.         localRect4.left = 55536;
  2403.         localRect3.top = 55536;
  2404.         localRect3.left = 55536;
  2405.         localRect2.top = 55536;
  2406.         localRect2.left = 55536;
  2407.         localRect4.bottom = 10000;
  2408.         localRect4.right = 10000;
  2409.         localRect3.bottom = 10000;
  2410.         localRect3.right = 10000;
  2411.         localRect2.bottom = 10000;
  2412.         localRect2.right = 10000;
  2413.       }
  2414.       WindowManagerPolicy.WindowState localWindowState4 = paramWindowState1;
  2415.       Rect localRect5 = localRect1;
  2416.       Rect localRect6 = localRect2;
  2417.       Rect localRect7 = localRect3;
  2418.       Rect localRect8 = localRect4;
  2419.       localWindowState4.computeFrameLw(localRect5, localRect6, localRect7, localRect8);
  2420.       if (paramLayoutParams.type != 2011)
  2421.         return;
  2422.       if (paramWindowState1.getGivenInsetsPendingLw())
  2423.         return;
  2424.       int i4 = paramWindowState1.getContentFrameLw().top;
  2425.       int i5 = paramWindowState1.getGivenContentInsetsLw().top;
  2426.       int i6 = i4 + i5;
  2427.       int i7 = this.mContentBottom;
  2428.       int i8 = i6;
  2429.       if (i7 > i8)
  2430.       {
  2431.         int i9 = i6;
  2432.         this.mContentBottom = i9;
  2433.       }
  2434.       int i10 = paramWindowState1.getVisibleFrameLw().top;
  2435.       int i11 = paramWindowState1.getGivenVisibleInsetsLw().top;
  2436.       int i12 = i10 + i11;
  2437.       int i13 = this.mCurBottom;
  2438.       int i14 = i12;
  2439.       if (i13 <= i14)
  2440.         return;
  2441.       int i15 = i12;
  2442.       this.mCurBottom = i15;
  2443.       return;
  2444.       int i16 = j & 0xF0;
  2445.       if ((0x10500 & i) == 65792)
  2446.       {
  2447.         if (paramWindowState2 != null)
  2448.         {
  2449.           PhoneWindowManager localPhoneWindowManager1 = this;
  2450.           WindowManagerPolicy.WindowState localWindowState5 = paramWindowState1;
  2451.           WindowManagerPolicy.WindowState localWindowState6 = paramWindowState2;
  2452.           localPhoneWindowManager1.setAttachedWindowFrames(localWindowState5, i, j, localWindowState6, 1, localRect1, localRect2, localRect3, localRect4);
  2453.           continue;
  2454.         }
  2455.         int i17 = this.mRestrictedScreenLeft;
  2456.         localRect2.left = i17;
  2457.         localRect1.left = i17;
  2458.         int i18 = this.mRestrictedScreenTop;
  2459.         localRect2.top = i18;
  2460.         localRect1.top = i18;
  2461.         int i19 = this.mRestrictedScreenLeft;
  2462.         int i20 = this.mRestrictedScreenWidth;
  2463.         int i21 = i19 + i20;
  2464.         localRect2.right = i21;
  2465.         localRect1.right = i21;
  2466.         int i22 = this.mRestrictedScreenTop;
  2467.         int i23 = this.mRestrictedScreenHeight;
  2468.         int i24 = i22 + i23;
  2469.         localRect2.bottom = i24;
  2470.         localRect1.bottom = i24;
  2471.         int i25 = i16;
  2472.         int i26 = 16;
  2473.         int i30;
  2474.         if (i25 != i26)
  2475.         {
  2476.           int i27 = this.mDockLeft;
  2477.           localRect3.left = i27;
  2478.           int i28 = this.mDockTop;
  2479.           localRect3.top = i28;
  2480.           int i29 = this.mDockRight;
  2481.           localRect3.right = i29;
  2482.           i30 = this.mDockBottom;
  2483.         }
  2484.         int i40;
  2485.         for (localRect3.bottom = i30; ; localRect3.bottom = i40)
  2486.         {
  2487.           int i31 = i16;
  2488.           int i32 = 48;
  2489.           if (i31 == i32)
  2490.             break label854;
  2491.           int i33 = this.mCurLeft;
  2492.           localRect4.left = i33;
  2493.           int i34 = this.mCurTop;
  2494.           localRect4.top = i34;
  2495.           int i35 = this.mCurRight;
  2496.           localRect4.right = i35;
  2497.           int i36 = this.mCurBottom;
  2498.           localRect4.bottom = i36;
  2499.           break;
  2500.           int i37 = this.mContentLeft;
  2501.           localRect3.left = i37;
  2502.           int i38 = this.mContentTop;
  2503.           localRect3.top = i38;
  2504.           int i39 = this.mContentRight;
  2505.           localRect3.right = i39;
  2506.           i40 = this.mContentBottom;
  2507.         }
  2508.         label854: localRect4.set(localRect3);
  2509.         continue;
  2510.       }
  2511.       if ((i & 0x100) != 0)
  2512.       {
  2513.         int i48;
  2514.         if (paramLayoutParams.type == 2014)
  2515.         {
  2516.           int i41 = this.mUnrestrictedScreenLeft;
  2517.           localRect3.left = i41;
  2518.           localRect2.left = i41;
  2519.           localRect1.left = i41;
  2520.           int i42 = this.mUnrestrictedScreenTop;
  2521.           localRect3.top = i42;
  2522.           localRect2.top = i42;
  2523.           localRect1.top = i42;
  2524.           int i43 = this.mUnrestrictedScreenLeft;
  2525.           int i44 = this.mUnrestrictedScreenWidth;
  2526.           int i45 = i43 + i44;
  2527.           localRect3.right = i45;
  2528.           localRect2.right = i45;
  2529.           localRect1.right = i45;
  2530.           int i46 = this.mUnrestrictedScreenTop;
  2531.           int i47 = this.mUnrestrictedScreenHeight;
  2532.           i48 = i46 + i47;
  2533.           localRect3.bottom = i48;
  2534.           localRect2.bottom = i48;
  2535.         }
  2536.         int i62;
  2537.         for (localRect1.bottom = i48; ; localRect1.bottom = i62)
  2538.         {
  2539.           int i49 = i16;
  2540.           int i50 = 48;
  2541.           if (i49 == i50)
  2542.             break label1224;
  2543.           int i51 = this.mCurLeft;
  2544.           localRect4.left = i51;
  2545.           int i52 = this.mCurTop;
  2546.           localRect4.top = i52;
  2547.           int i53 = this.mCurRight;
  2548.           localRect4.right = i53;
  2549.           int i54 = this.mCurBottom;
  2550.           localRect4.bottom = i54;
  2551.           break;
  2552.           int i55 = this.mRestrictedScreenLeft;
  2553.           localRect3.left = i55;
  2554.           localRect2.left = i55;
  2555.           localRect1.left = i55;
  2556.           int i56 = this.mRestrictedScreenTop;
  2557.           localRect3.top = i56;
  2558.           localRect2.top = i56;
  2559.           localRect1.top = i56;
  2560.           int i57 = this.mRestrictedScreenLeft;
  2561.           int i58 = this.mRestrictedScreenWidth;
  2562.           int i59 = i57 + i58;
  2563.           localRect3.right = i59;
  2564.           localRect2.right = i59;
  2565.           localRect1.right = i59;
  2566.           int i60 = this.mRestrictedScreenTop;
  2567.           int i61 = this.mRestrictedScreenHeight;
  2568.           i62 = i60 + i61;
  2569.           localRect3.bottom = i62;
  2570.           localRect2.bottom = i62;
  2571.         }
  2572.         label1224: localRect4.set(localRect3);
  2573.         continue;
  2574.       }
  2575.       if (paramWindowState2 != null)
  2576.       {
  2577.         PhoneWindowManager localPhoneWindowManager2 = this;
  2578.         WindowManagerPolicy.WindowState localWindowState7 = paramWindowState1;
  2579.         int i63 = i;
  2580.         WindowManagerPolicy.WindowState localWindowState8 = paramWindowState2;
  2581.         Rect localRect9 = localRect1;
  2582.         Rect localRect10 = localRect2;
  2583.         Rect localRect11 = localRect3;
  2584.         Rect localRect12 = localRect4;
  2585.         localPhoneWindowManager2.setAttachedWindowFrames(localWindowState7, i63, i16, localWindowState8, 0, localRect9, localRect10, localRect11, localRect12);
  2586.         continue;
  2587.       }
  2588.       if (paramLayoutParams.type == 2014)
  2589.       {
  2590.         int i64 = this.mRestrictedScreenLeft;
  2591.         localRect3.left = i64;
  2592.         localRect2.left = i64;
  2593.         localRect1.left = i64;
  2594.         int i65 = this.mRestrictedScreenTop;
  2595.         localRect3.top = i65;
  2596.         localRect2.top = i65;
  2597.         localRect1.top = i65;
  2598.         int i66 = this.mRestrictedScreenLeft;
  2599.         int i67 = this.mRestrictedScreenWidth;
  2600.         int i68 = i66 + i67;
  2601.         localRect3.right = i68;
  2602.         localRect2.right = i68;
  2603.         localRect1.right = i68;
  2604.         int i69 = this.mRestrictedScreenTop;
  2605.         int i70 = this.mRestrictedScreenHeight;
  2606.         int i71 = i69 + i70;
  2607.         localRect3.bottom = i71;
  2608.         localRect2.bottom = i71;
  2609.         localRect1.bottom = i71;
  2610.         continue;
  2611.       }
  2612.       int i72 = this.mContentLeft;
  2613.       localRect1.left = i72;
  2614.       int i73 = this.mContentTop;
  2615.       localRect1.top = i73;
  2616.       int i74 = this.mContentRight;
  2617.       localRect1.right = i74;
  2618.       int i75 = this.mContentBottom;
  2619.       localRect1.bottom = i75;
  2620.       int i76 = i16;
  2621.       int i77 = 16;
  2622.       int i81;
  2623.       if (i76 != i77)
  2624.       {
  2625.         int i78 = this.mDockLeft;
  2626.         localRect3.left = i78;
  2627.         localRect2.left = i78;
  2628.         int i79 = this.mDockTop;
  2629.         localRect3.top = i79;
  2630.         localRect2.top = i79;
  2631.         int i80 = this.mDockRight;
  2632.         localRect3.right = i80;
  2633.         localRect2.right = i80;
  2634.         i81 = this.mDockBottom;
  2635.         localRect3.bottom = i81;
  2636.       }
  2637.       int i91;
  2638.       for (localRect2.bottom = i81; ; localRect2.bottom = i91)
  2639.       {
  2640.         int i82 = i16;
  2641.         int i83 = 48;
  2642.         if (i82 == i83)
  2643.           break label1740;
  2644.         int i84 = this.mCurLeft;
  2645.         localRect4.left = i84;
  2646.         int i85 = this.mCurTop;
  2647.         localRect4.top = i85;
  2648.         int i86 = this.mCurRight;
  2649.         localRect4.right = i86;
  2650.         int i87 = this.mCurBottom;
  2651.         localRect4.bottom = i87;
  2652.         break;
  2653.         int i88 = this.mContentLeft;
  2654.         localRect3.left = i88;
  2655.         localRect2.left = i88;
  2656.         int i89 = this.mContentTop;
  2657.         localRect3.top = i89;
  2658.         localRect2.top = i89;
  2659.         int i90 = this.mContentRight;
  2660.         localRect3.right = i90;
  2661.         localRect2.right = i90;
  2662.         i91 = this.mContentBottom;
  2663.         localRect3.bottom = i91;
  2664.       }
  2665.       label1740: localRect4.set(localRect3);
  2666.     }
  2667.   }
  2668.  
  2669.   boolean needSensorRunningLp()
  2670.   {
  2671.     int i;
  2672.     if ((this.mCurrentAppOrientation == 4) || (this.mCurrentAppOrientation == 10) || (this.mCurrentAppOrientation == 7) || (this.mCurrentAppOrientation == 6))
  2673.       i = 1;
  2674.     while (true)
  2675.     {
  2676.       return i;
  2677.       if (((this.mCarDockEnablesAccelerometer) && (this.mDockMode == 2)) || ((this.mDeskDockEnablesAccelerometer) && (this.mDockMode == 1)))
  2678.       {
  2679.         i = 1;
  2680.         continue;
  2681.       }
  2682.       if (this.mAccelerometerDefault == 0)
  2683.       {
  2684.         i = 0;
  2685.         continue;
  2686.       }
  2687.       i = 1;
  2688.     }
  2689.   }
  2690.  
  2691.   public void notifyLidSwitchChanged(long paramLong, boolean paramBoolean)
  2692.   {
  2693.     if (paramBoolean);
  2694.     for (int i = 1; ; i = 0)
  2695.     {
  2696.       this.mLidOpen = i;
  2697.       boolean bool1 = this.mKeyguardMediator.doLidChangeTq(paramBoolean);
  2698.       updateRotation(1);
  2699.       if (!bool1)
  2700.         break;
  2701.       this.mKeyguardMediator.pokeWakelock();
  2702.       return;
  2703.     }
  2704.     if (keyguardIsShowingTq())
  2705.     {
  2706.       if (!paramBoolean)
  2707.         return;
  2708.       boolean bool2 = this.mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(26);
  2709.       return;
  2710.     }
  2711.     if (paramBoolean)
  2712.     {
  2713.       LocalPowerManager localLocalPowerManager1 = this.mPowerManager;
  2714.       long l1 = SystemClock.uptimeMillis();
  2715.       localLocalPowerManager1.userActivity(l1, 0, 1);
  2716.       return;
  2717.     }
  2718.     LocalPowerManager localLocalPowerManager2 = this.mPowerManager;
  2719.     long l2 = SystemClock.uptimeMillis();
  2720.     localLocalPowerManager2.userActivity(l2, 0, 0);
  2721.   }
  2722.  
  2723.   public boolean performHapticFeedbackLw(WindowManagerPolicy.WindowState paramWindowState, int paramInt, boolean paramBoolean)
  2724.   {
  2725.     int i;
  2726.     if (Settings.System.getInt(this.mContext.getContentResolver(), "haptic_feedback_enabled", 0) == 0)
  2727.     {
  2728.       i = 1;
  2729.       if ((paramBoolean) || ((i == 0) && (!this.mKeyguardMediator.isShowingAndNotHidden())))
  2730.         break label51;
  2731.     }
  2732.     for (int j = 0; ; j = 0)
  2733.     {
  2734.       return j;
  2735.       i = 0;
  2736.       break;
  2737.       label51: switch (paramInt)
  2738.       {
  2739.       default:
  2740.       case 0:
  2741.       case 1:
  2742.       case 3:
  2743.       case 10000:
  2744.       case 10001:
  2745.       }
  2746.     }
  2747.     long[] arrayOfLong = this.mLongPressVibePattern;
  2748.     label116: if (arrayOfLong.length == 1)
  2749.     {
  2750.       Vibrator localVibrator = this.mVibrator;
  2751.       long l = arrayOfLong[0];
  2752.       localVibrator.vibrate(l);
  2753.     }
  2754.     while (true)
  2755.     {
  2756.       j = 1;
  2757.       break;
  2758.       arrayOfLong = this.mVirtualKeyVibePattern;
  2759.       break label116;
  2760.       arrayOfLong = this.mKeyboardTapVibePattern;
  2761.       break label116;
  2762.       arrayOfLong = this.mSafeModeDisabledVibePattern;
  2763.       break label116;
  2764.       arrayOfLong = this.mSafeModeEnabledVibePattern;
  2765.       break label116;
  2766.       this.mVibrator.vibrate(arrayOfLong, -1);
  2767.     }
  2768.   }
  2769.  
  2770.   public int prepareAddWindowLw(WindowManagerPolicy.WindowState paramWindowState, WindowManager.LayoutParams paramLayoutParams)
  2771.   {
  2772.     switch (paramLayoutParams.type)
  2773.     {
  2774.     default:
  2775.     case 2000:
  2776.     case 2014:
  2777.     case 2017:
  2778.     case 2004:
  2779.     }
  2780.     while (true)
  2781.     {
  2782.       int i = 0;
  2783.       while (true)
  2784.       {
  2785.         return i;
  2786.         this.mContext.enforceCallingOrSelfPermission("android.permission.STATUS_BAR_SERVICE", "PhoneWindowManager");
  2787.         if (this.mStatusBar != null)
  2788.         {
  2789.           i = -1;
  2790.           continue;
  2791.         }
  2792.         this.mStatusBar = paramWindowState;
  2793.         break;
  2794.         this.mContext.enforceCallingOrSelfPermission("android.permission.STATUS_BAR_SERVICE", "PhoneWindowManager");
  2795.         boolean bool1 = this.mStatusBarPanels.add(paramWindowState);
  2796.         break;
  2797.         this.mContext.enforceCallingOrSelfPermission("android.permission.STATUS_BAR_SERVICE", "PhoneWindowManager");
  2798.         boolean bool2 = this.mStatusBarPanels.add(paramWindowState);
  2799.         break;
  2800.         if (this.mKeyguard == null)
  2801.           break label151;
  2802.         i = -1;
  2803.       }
  2804.       label151: this.mKeyguard = paramWindowState;
  2805.     }
  2806.   }
  2807.  
  2808.   // ERROR //
  2809.   boolean readHdmiState()
  2810.   {
  2811.     // Byte code:
  2812.     //   0: aconst_null
  2813.     //   1: astore_1
  2814.     //   2: new 1633    java/io/FileReader
  2815.     //   5: dup
  2816.     //   6: ldc_w 1635
  2817.     //   9: invokespecial 1636  java/io/FileReader:<init>   (Ljava/lang/String;)V
  2818.     //   12: astore_2
  2819.     //   13: bipush 15
  2820.     //   15: istore_3
  2821.     //   16: iload_3
  2822.     //   17: newarray char
  2823.     //   19: astore 4
  2824.     //   21: aload_2
  2825.     //   22: aload 4
  2826.     //   24: invokevirtual 1640 java/io/FileReader:read ([C)I
  2827.     //   27: istore 5
  2828.     //   29: iload 5
  2829.     //   31: iconst_1
  2830.     //   32: if_icmple +54 -> 86
  2831.     //   35: iload 5
  2832.     //   37: iconst_1
  2833.     //   38: isub
  2834.     //   39: istore 6
  2835.     //   41: new 1346   java/lang/String
  2836.     //   44: dup
  2837.     //   45: aload 4
  2838.     //   47: iconst_0
  2839.     //   48: iload 6
  2840.     //   50: invokespecial 1643 java/lang/String:<init> ([CII)V
  2841.     //   53: invokestatic 1648  java/lang/Integer:parseInt  (Ljava/lang/String;)I
  2842.     //   56: istore 7
  2843.     //   58: iload 7
  2844.     //   60: ifeq +20 -> 80
  2845.     //   63: iconst_1
  2846.     //   64: istore 8
  2847.     //   66: aload_2
  2848.     //   67: ifnull +7 -> 74
  2849.     //   70: aload_2
  2850.     //   71: invokevirtual 1651 java/io/FileReader:close    ()V
  2851.     //   74: aload_2
  2852.     //   75: astore 9
  2853.     //   77: iload 8
  2854.     //   79: ireturn
  2855.     //   80: iconst_0
  2856.     //   81: istore 8
  2857.     //   83: goto -17 -> 66
  2858.     //   86: aload_2
  2859.     //   87: ifnull +7 -> 94
  2860.     //   90: aload_2
  2861.     //   91: invokevirtual 1651 java/io/FileReader:close    ()V
  2862.     //   94: aload_2
  2863.     //   95: astore 10
  2864.     //   97: iconst_0
  2865.     //   98: istore 8
  2866.     //   100: goto -23 -> 77
  2867.     //   103: astore 11
  2868.     //   105: new 658   java/lang/StringBuilder
  2869.     //   108: dup
  2870.     //   109: invokespecial 659 java/lang/StringBuilder:<init>  ()V
  2871.     //   112: ldc_w 1653
  2872.     //   115: invokevirtual 665 java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  2873.     //   118: aload 11
  2874.     //   120: invokevirtual 698 java/lang/StringBuilder:append  (Ljava/lang/Object;)Ljava/lang/StringBuilder;
  2875.     //   123: invokevirtual 669 java/lang/StringBuilder:toString    ()Ljava/lang/String;
  2876.     //   126: astore 12
  2877.     //   128: ldc 97
  2878.     //   130: aload 12
  2879.     //   132: invokestatic 1654 android/util/Slog:d (Ljava/lang/String;Ljava/lang/String;)I
  2880.     //   135: istore 13
  2881.     //   137: aload_1
  2882.     //   138: ifnull +7 -> 145
  2883.     //   141: aload_1
  2884.     //   142: invokevirtual 1651    java/io/FileReader:close    ()V
  2885.     //   145: iconst_0
  2886.     //   146: istore 8
  2887.     //   148: goto -71 -> 77
  2888.     //   151: astore 11
  2889.     //   153: new 658   java/lang/StringBuilder
  2890.     //   156: dup
  2891.     //   157: invokespecial 659 java/lang/StringBuilder:<init>  ()V
  2892.     //   160: ldc_w 1653
  2893.     //   163: invokevirtual 665 java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  2894.     //   166: aload 11
  2895.     //   168: invokevirtual 698 java/lang/StringBuilder:append  (Ljava/lang/Object;)Ljava/lang/StringBuilder;
  2896.     //   171: invokevirtual 669 java/lang/StringBuilder:toString    ()Ljava/lang/String;
  2897.     //   174: astore 14
  2898.     //   176: ldc 97
  2899.     //   178: aload 14
  2900.     //   180: invokestatic 1654 android/util/Slog:d (Ljava/lang/String;Ljava/lang/String;)I
  2901.     //   183: istore 15
  2902.     //   185: aload_1
  2903.     //   186: ifnull +7 -> 193
  2904.     //   189: aload_1
  2905.     //   190: invokevirtual 1651    java/io/FileReader:close    ()V
  2906.     //   193: iconst_0
  2907.     //   194: istore 8
  2908.     //   196: goto -119 -> 77
  2909.     //   199: astore 16
  2910.     //   201: aload_1
  2911.     //   202: ifnull +7 -> 209
  2912.     //   205: aload_1
  2913.     //   206: invokevirtual 1651    java/io/FileReader:close    ()V
  2914.     //   209: aload 16
  2915.     //   211: athrow
  2916.     //   212: astore 17
  2917.     //   214: goto -140 -> 74
  2918.     //   217: astore 18
  2919.     //   219: goto -125 -> 94
  2920.     //   222: astore 19
  2921.     //   224: goto -79 -> 145
  2922.     //   227: astore 20
  2923.     //   229: goto -36 -> 193
  2924.     //   232: astore 21
  2925.     //   234: goto -25 -> 209
  2926.     //   237: astore 16
  2927.     //   239: aload_2
  2928.     //   240: astore_1
  2929.     //   241: goto -40 -> 201
  2930.     //   244: astore 11
  2931.     //   246: aload_2
  2932.     //   247: astore_1
  2933.     //   248: goto -95 -> 153
  2934.     //   251: astore 11
  2935.     //   253: aload_2
  2936.     //   254: astore_1
  2937.     //   255: goto -150 -> 105
  2938.     //
  2939.     // Exception table:
  2940.     //   from   to  target  type
  2941.     //   2  13  103 java/io/IOException
  2942.     //   2  13  151 java/lang/NumberFormatException
  2943.     //   2  13  199 finally
  2944.     //   105    137 199 finally
  2945.     //   153    185 199 finally
  2946.     //   70 74  212 java/io/IOException
  2947.     //   90 94  217 java/io/IOException
  2948.     //   141    145 222 java/io/IOException
  2949.     //   189    193 227 java/io/IOException
  2950.     //   205    209 232 java/io/IOException
  2951.     //   16 58  237 finally
  2952.     //   16 58  244 java/lang/NumberFormatException
  2953.     //   16 58  251 java/io/IOException
  2954.   }
  2955.  
  2956.   void readLidState()
  2957.   {
  2958.     try
  2959.     {
  2960.       int i = this.mWindowManager.getSwitchState(0);
  2961.       if (i > 0)
  2962.       {
  2963.         this.mLidOpen = 1;
  2964.         return;
  2965.       }
  2966.       if (i == 0)
  2967.       {
  2968.         this.mLidOpen = 0;
  2969.         return;
  2970.       }
  2971.     }
  2972.     catch (RemoteException localRemoteException)
  2973.     {
  2974.       return;
  2975.     }
  2976.     this.mLidOpen = -1;
  2977.   }
  2978.  
  2979.   public void removeStartingWindow(IBinder paramIBinder, View paramView)
  2980.   {
  2981.     if (paramView == null)
  2982.       return;
  2983.     ((WindowManager)this.mContext.getSystemService("window")).removeView(paramView);
  2984.   }
  2985.  
  2986.   public void removeWindowLw(WindowManagerPolicy.WindowState paramWindowState)
  2987.   {
  2988.     if (this.mStatusBar == paramWindowState)
  2989.     {
  2990.       this.mStatusBar = null;
  2991.       return;
  2992.     }
  2993.     if (this.mKeyguard == paramWindowState)
  2994.     {
  2995.       this.mKeyguard = null;
  2996.       return;
  2997.     }
  2998.     boolean bool = this.mStatusBarPanels.remove(paramWindowState);
  2999.   }
  3000.  
  3001.   public int rotationForOrientationLw(int paramInt1, int paramInt2, boolean paramBoolean)
  3002.   {
  3003.     Object localObject1 = this.mLock;
  3004.     monitorenter;
  3005.     switch (paramInt1)
  3006.     {
  3007.     case 2:
  3008.     case 3:
  3009.     case 4:
  3010.     case 5:
  3011.     default:
  3012.     case 1:
  3013.     case 0:
  3014.     case 9:
  3015.     case 8:
  3016.     case 6:
  3017.     case 7:
  3018.     }
  3019.     try
  3020.     {
  3021.       if (this.mHdmiPlugged)
  3022.         monitorexit;
  3023.       while (true)
  3024.       {
  3025.         return i;
  3026.         int j = this.mPortraitRotation;
  3027.         monitorexit;
  3028.         i = j;
  3029.         continue;
  3030.         int k = this.mLandscapeRotation;
  3031.         monitorexit;
  3032.         i = k;
  3033.         continue;
  3034.         int m = this.mUpsideDownRotation;
  3035.         monitorexit;
  3036.         i = m;
  3037.         continue;
  3038.         int n = this.mSeascapeRotation;
  3039.         monitorexit;
  3040.         i = n;
  3041.         continue;
  3042.         int i1 = getCurrentLandscapeRotation(paramInt2);
  3043.         monitorexit;
  3044.         i = i1;
  3045.         continue;
  3046.         int i2 = getCurrentPortraitRotation(paramInt2);
  3047.         monitorexit;
  3048.         i = i2;
  3049.         continue;
  3050.         if (this.mLidOpen == 1)
  3051.         {
  3052.           int i3 = this.mLidOpenRotation;
  3053.           monitorexit;
  3054.           i = i3;
  3055.           continue;
  3056.         }
  3057.         if ((this.mDockMode == 2) && (this.mCarDockRotation >= 0))
  3058.         {
  3059.           int i4 = this.mCarDockRotation;
  3060.           monitorexit;
  3061.           i = i4;
  3062.           continue;
  3063.         }
  3064.         if ((this.mDockMode == 1) && (this.mDeskDockRotation >= 0))
  3065.         {
  3066.           int i5 = this.mDeskDockRotation;
  3067.           monitorexit;
  3068.           i = i5;
  3069.           continue;
  3070.         }
  3071.         if (this.mUserRotationMode == 1)
  3072.         {
  3073.           int i6 = this.mUserRotation;
  3074.           monitorexit;
  3075.           i = i6;
  3076.           continue;
  3077.         }
  3078.         if (!useSensorForOrientationLp(paramInt1))
  3079.           break;
  3080.         int i7 = this.mOrientationListener.getCurrentRotation(paramInt2);
  3081.         if ((i7 == 2) && (!this.mAllowAllRotations) && (paramInt1 != 10))
  3082.         {
  3083.           monitorexit;
  3084.           i = paramInt2;
  3085.           continue;
  3086.         }
  3087.         monitorexit;
  3088.         i = i7;
  3089.       }
  3090.       monitorexit;
  3091.       i = 0;
  3092.     }
  3093.     finally
  3094.     {
  3095.       int i;
  3096.       monitorexit;
  3097.     }
  3098.   }
  3099.  
  3100.   public void screenOnStoppedLw()
  3101.   {
  3102.     if (this.mKeyguardMediator.isShowingAndNotHidden())
  3103.       return;
  3104.     if (!this.mPowerManager.isScreenOn())
  3105.       return;
  3106.     long l = SystemClock.uptimeMillis();
  3107.     this.mPowerManager.userActivity(l, 0, 0);
  3108.   }
  3109.  
  3110.   public void screenTurnedOff(int paramInt)
  3111.   {
  3112.     int i = EventLog.writeEvent(70000, 0);
  3113.     this.mKeyguardMediator.onScreenTurnedOff(paramInt);
  3114.     synchronized (this.mLock)
  3115.     {
  3116.       this.mScreenOn = 0;
  3117.       updateOrientationListenerLp();
  3118.       updateLockScreenTimeout();
  3119.       return;
  3120.     }
  3121.   }
  3122.  
  3123.   public void screenTurnedOn()
  3124.   {
  3125.     int i = EventLog.writeEvent(70000, 1);
  3126.     this.mKeyguardMediator.onScreenTurnedOn();
  3127.     synchronized (this.mLock)
  3128.     {
  3129.       this.mScreenOn = 1;
  3130.       updateOrientationListenerLp();
  3131.       updateLockScreenTimeout();
  3132.       return;
  3133.     }
  3134.   }
  3135.  
  3136.   public int selectAnimationLw(WindowManagerPolicy.WindowState paramWindowState, int paramInt)
  3137.   {
  3138.     if ((paramInt == 5) && (paramWindowState.hasAppShownWindows()));
  3139.     for (int i = 17432593; ; i = 0)
  3140.       return i;
  3141.   }
  3142.  
  3143.   void sendCloseSystemWindows()
  3144.   {
  3145.     sendCloseSystemWindows(this.mContext, null);
  3146.   }
  3147.  
  3148.   void sendCloseSystemWindows(String paramString)
  3149.   {
  3150.     sendCloseSystemWindows(this.mContext, paramString);
  3151.   }
  3152.  
  3153.   void setAttachedWindowFrames(WindowManagerPolicy.WindowState paramWindowState1, int paramInt1, int paramInt2, WindowManagerPolicy.WindowState paramWindowState2, boolean paramBoolean, Rect paramRect1, Rect paramRect2, Rect paramRect3, Rect paramRect4)
  3154.   {
  3155.     int i = paramWindowState1.getSurfaceLayer();
  3156.     int j = this.mDockLayer;
  3157.     if (i > j)
  3158.     {
  3159.       int k = paramWindowState2.getSurfaceLayer();
  3160.       int m = this.mDockLayer;
  3161.       if (k < m)
  3162.       {
  3163.         int n = this.mDockLeft;
  3164.         paramRect4.left = n;
  3165.         paramRect3.left = n;
  3166.         paramRect2.left = n;
  3167.         int i1 = this.mDockTop;
  3168.         paramRect4.top = i1;
  3169.         paramRect3.top = i1;
  3170.         paramRect2.top = i1;
  3171.         int i2 = this.mDockRight;
  3172.         paramRect4.right = i2;
  3173.         paramRect3.right = i2;
  3174.         paramRect2.right = i2;
  3175.         int i3 = this.mDockBottom;
  3176.         paramRect4.bottom = i3;
  3177.         paramRect3.bottom = i3;
  3178.         paramRect2.bottom = i3;
  3179.         if ((paramInt1 & 0x100) != 0)
  3180.           break label418;
  3181.       }
  3182.     }
  3183.     label411: label418: for (Rect localRect1 = paramWindowState2.getFrameLw(); ; localRect1 = paramRect2)
  3184.     {
  3185.       paramRect1.set(localRect1);
  3186.       return;
  3187.       if (paramInt2 != 16)
  3188.       {
  3189.         Rect localRect2 = paramWindowState2.getDisplayFrameLw();
  3190.         paramRect3.set(localRect2);
  3191.         label198: if (!paramBoolean)
  3192.           break label411;
  3193.       }
  3194.       for (Rect localRect3 = paramWindowState2.getDisplayFrameLw(); ; localRect3 = paramRect3)
  3195.       {
  3196.         paramRect2.set(localRect3);
  3197.         Rect localRect4 = paramWindowState2.getVisibleFrameLw();
  3198.         paramRect4.set(localRect4);
  3199.         break;
  3200.         Rect localRect5 = paramWindowState2.getContentFrameLw();
  3201.         paramRect3.set(localRect5);
  3202.         int i4 = paramWindowState2.getSurfaceLayer();
  3203.         int i5 = this.mDockLayer;
  3204.         if (i4 >= i5)
  3205.           break label198;
  3206.         int i6 = paramRect3.left;
  3207.         int i7 = this.mContentLeft;
  3208.         if (i6 < i7)
  3209.         {
  3210.           int i8 = this.mContentLeft;
  3211.           paramRect3.left = i8;
  3212.         }
  3213.         int i9 = paramRect3.top;
  3214.         int i10 = this.mContentTop;
  3215.         if (i9 < i10)
  3216.         {
  3217.           int i11 = this.mContentTop;
  3218.           paramRect3.top = i11;
  3219.         }
  3220.         int i12 = paramRect3.right;
  3221.         int i13 = this.mContentRight;
  3222.         if (i12 > i13)
  3223.         {
  3224.           int i14 = this.mContentRight;
  3225.           paramRect3.right = i14;
  3226.         }
  3227.         int i15 = paramRect3.bottom;
  3228.         int i16 = this.mContentBottom;
  3229.         if (i15 <= i16)
  3230.           break label198;
  3231.         int i17 = this.mContentBottom;
  3232.         paramRect3.bottom = i17;
  3233.         break label198;
  3234.       }
  3235.     }
  3236.   }
  3237.  
  3238.   public void setCurrentOrientationLw(int paramInt)
  3239.   {
  3240.     synchronized (this.mLock)
  3241.     {
  3242.       int i = this.mCurrentAppOrientation;
  3243.       if (paramInt != i)
  3244.       {
  3245.         this.mCurrentAppOrientation = paramInt;
  3246.         updateOrientationListenerLp();
  3247.       }
  3248.       return;
  3249.     }
  3250.   }
  3251.  
  3252.   void setHdmiPlugged(boolean paramBoolean)
  3253.   {
  3254.     if (this.mHdmiPlugged == paramBoolean)
  3255.       return;
  3256.     this.mHdmiPlugged = paramBoolean;
  3257.     updateRotation(1);
  3258.     Intent localIntent1 = new Intent("android.intent.action.HDMI_PLUGGED");
  3259.     Intent localIntent2 = localIntent1.addFlags(268435456);
  3260.     Intent localIntent3 = localIntent1.putExtra("state", paramBoolean);
  3261.     this.mContext.sendStickyBroadcast(localIntent1);
  3262.   }
  3263.  
  3264.   public void setInitialDisplaySize(int paramInt1, int paramInt2)
  3265.   {
  3266.     int i;
  3267.     int m;
  3268.     label70: Resources localResources;
  3269.     if (paramInt1 > paramInt2)
  3270.     {
  3271.       i = paramInt2;
  3272.       this.mLandscapeRotation = 0;
  3273.       this.mSeascapeRotation = 2;
  3274.       if (this.mContext.getResources().getBoolean(17891341))
  3275.       {
  3276.         this.mPortraitRotation = 1;
  3277.         this.mUpsideDownRotation = 3;
  3278.         int j = i * 160;
  3279.         int k = DisplayMetrics.DENSITY_DEVICE;
  3280.         if (j / k >= 600)
  3281.           break label180;
  3282.         m = 1;
  3283.         this.mStatusBarCanHide = m;
  3284.         localResources = this.mContext.getResources();
  3285.         if (!this.mStatusBarCanHide)
  3286.           break label187;
  3287.       }
  3288.     }
  3289.     label180: label187: for (int n = 17104905; ; n = 17104906)
  3290.     {
  3291.       int i1 = localResources.getDimensionPixelSize(n);
  3292.       this.mStatusBarHeight = i1;
  3293.       return;
  3294.       this.mPortraitRotation = 3;
  3295.       this.mUpsideDownRotation = 1;
  3296.       break;
  3297.       i = paramInt1;
  3298.       this.mPortraitRotation = 0;
  3299.       this.mUpsideDownRotation = 2;
  3300.       if (this.mContext.getResources().getBoolean(17891341))
  3301.       {
  3302.         this.mLandscapeRotation = 3;
  3303.         this.mSeascapeRotation = 1;
  3304.         break;
  3305.       }
  3306.       this.mLandscapeRotation = 1;
  3307.       this.mSeascapeRotation = 3;
  3308.       break;
  3309.       m = 0;
  3310.       break label70;
  3311.     }
  3312.   }
  3313.  
  3314.   public void setUserRotationMode(int paramInt1, int paramInt2)
  3315.   {
  3316.     ContentResolver localContentResolver = this.mContext.getContentResolver();
  3317.     if (paramInt1 == 1)
  3318.     {
  3319.       boolean bool1 = Settings.System.putInt(localContentResolver, "user_rotation", paramInt2);
  3320.       boolean bool2 = Settings.System.putInt(localContentResolver, "accelerometer_rotation", 0);
  3321.       return;
  3322.     }
  3323.     boolean bool3 = Settings.System.putInt(localContentResolver, "accelerometer_rotation", 1);
  3324.   }
  3325.  
  3326.   void showGlobalActionsDialog()
  3327.   {
  3328.     if (this.mGlobalActions == null)
  3329.     {
  3330.       Context localContext = this.mContext;
  3331.       GlobalActions localGlobalActions1 = new GlobalActions(localContext);
  3332.       this.mGlobalActions = localGlobalActions1;
  3333.     }
  3334.     boolean bool1 = this.mKeyguardMediator.isShowingAndNotHidden();
  3335.     GlobalActions localGlobalActions2 = this.mGlobalActions;
  3336.     boolean bool2 = isDeviceProvisioned();
  3337.     localGlobalActions2.showDialog(bool1, bool2);
  3338.     if (!bool1)
  3339.       return;
  3340.     this.mKeyguardMediator.pokeWakelock();
  3341.   }
  3342.  
  3343.   void showOrHideRecentAppsDialog(int paramInt, boolean paramBoolean)
  3344.   {
  3345.     Handler localHandler = this.mHandler;
  3346.     PhoneWindowManager.5 local5 = new PhoneWindowManager.5(this, paramBoolean, paramInt);
  3347.     boolean bool = localHandler.post(local5);
  3348.   }
  3349.  
  3350.   void startDockOrHome()
  3351.   {
  3352.     Intent localIntent1 = createHomeDockIntent();
  3353.     if (localIntent1 != null)
  3354.       try
  3355.       {
  3356.         this.mContext.startActivity(localIntent1);
  3357.         return;
  3358.       }
  3359.       catch (ActivityNotFoundException localActivityNotFoundException)
  3360.       {
  3361.       }
  3362.     Context localContext = this.mContext;
  3363.     Intent localIntent2 = this.mHomeIntent;
  3364.     localContext.startActivity(localIntent2);
  3365.   }
  3366.  
  3367.   public int subWindowTypeToLayerLw(int paramInt)
  3368.   {
  3369.     int j;
  3370.     switch (paramInt)
  3371.     {
  3372.     default:
  3373.       String str = "Unknown sub-window type: " + paramInt;
  3374.       int i = Log.e("WindowManager", str);
  3375.       j = 0;
  3376.     case 1000:
  3377.     case 1003:
  3378.     case 1001:
  3379.     case 1004:
  3380.     case 1002:
  3381.     }
  3382.     while (true)
  3383.     {
  3384.       return j;
  3385.       j = 1;
  3386.       continue;
  3387.       j = -1;
  3388.       continue;
  3389.       j = -1;
  3390.       continue;
  3391.       j = 2;
  3392.     }
  3393.   }
  3394.  
  3395.   public void systemReady()
  3396.   {
  3397.     this.mKeyguardMediator.onSystemReady();
  3398.     SystemProperties.set("dev.bootcomplete", "1");
  3399.     synchronized (this.mLock)
  3400.     {
  3401.       updateOrientationListenerLp();
  3402.       this.mSystemReady = 1;
  3403.       Handler localHandler = this.mHandler;
  3404.       PhoneWindowManager.11 local11 = new PhoneWindowManager.11(this);
  3405.       boolean bool = localHandler.post(local11);
  3406.       return;
  3407.     }
  3408.   }
  3409.  
  3410.   void updateOrientationListenerLp()
  3411.   {
  3412.     if (!this.mOrientationListener.canDetectOrientation())
  3413.       return;
  3414.     int i = 1;
  3415.     if ((this.mScreenOn) && (needSensorRunningLp()))
  3416.     {
  3417.       i = 0;
  3418.       if (!this.mOrientationSensorEnabled)
  3419.       {
  3420.         this.mOrientationListener.enable();
  3421.         this.mOrientationSensorEnabled = 1;
  3422.       }
  3423.     }
  3424.     if (i == 0)
  3425.       return;
  3426.     if (!this.mOrientationSensorEnabled)
  3427.       return;
  3428.     this.mOrientationListener.disable();
  3429.     this.mOrientationSensorEnabled = 0;
  3430.   }
  3431.  
  3432.   void updateRotation(int paramInt)
  3433.   {
  3434.     LocalPowerManager localLocalPowerManager = this.mPowerManager;
  3435.     int i;
  3436.     if (this.mLidOpen == 1)
  3437.       i = 1;
  3438.     while (true)
  3439.     {
  3440.       localLocalPowerManager.setKeyboardVisibility(i);
  3441.       int k = 0;
  3442.       if (this.mHdmiPlugged)
  3443.         k = 0;
  3444.       try
  3445.       {
  3446.         while (true)
  3447.         {
  3448.           IWindowManager localIWindowManager = this.mWindowManager;
  3449.           int m = this.mFancyRotationAnimation | paramInt;
  3450.           localIWindowManager.setRotation(k, 1, m);
  3451.           return;
  3452.           int j = 0;
  3453.           break;
  3454.           if (this.mLidOpen == 1)
  3455.           {
  3456.             k = this.mLidOpenRotation;
  3457.             continue;
  3458.           }
  3459.           if ((this.mDockMode == 2) && (this.mCarDockRotation >= 0))
  3460.           {
  3461.             k = this.mCarDockRotation;
  3462.             continue;
  3463.           }
  3464.           if ((this.mDockMode != 1) || (this.mDeskDockRotation < 0))
  3465.             continue;
  3466.           k = this.mDeskDockRotation;
  3467.         }
  3468.       }
  3469.       catch (RemoteException localRemoteException)
  3470.       {
  3471.       }
  3472.     }
  3473.   }
  3474.  
  3475.   public void updateSettings()
  3476.   {
  3477.     ContentResolver localContentResolver = this.mContext.getContentResolver();
  3478.     int i = 0;
  3479.     PointerLocationView localPointerLocationView1 = null;
  3480.     Object localObject1 = null;
  3481.     while (true)
  3482.     {
  3483.       int i7;
  3484.       synchronized (this.mLock)
  3485.       {
  3486.         int j = Settings.System.getInt(localContentResolver, "end_button_behavior", 2);
  3487.         this.mEndcallBehavior = j;
  3488.         int k = Settings.Secure.getInt(localContentResolver, "incall_power_button_behavior", 1);
  3489.         this.mIncallPowerBehavior = k;
  3490.         if (Settings.System.getInt(localContentResolver, "fancy_rotation_anim", 0) != 0)
  3491.         {
  3492.           int m = 128;
  3493.           this.mFancyRotationAnimation = m;
  3494.           int i1 = Settings.System.getInt(localContentResolver, "accelerometer_rotation", 0);
  3495.           if (i1 != 0)
  3496.             break label505;
  3497.           m = 1;
  3498.           this.mUserRotationMode = m;
  3499.           int i2 = Settings.System.getInt(localContentResolver, "user_rotation", 0);
  3500.           this.mUserRotation = i2;
  3501.           if (this.mAccelerometerDefault == i1)
  3502.             continue;
  3503.           this.mAccelerometerDefault = i1;
  3504.           updateOrientationListenerLp();
  3505.           MyOrientationListener localMyOrientationListener = this.mOrientationListener;
  3506.           if (Settings.System.getInt(localContentResolver, "window_orientation_listener_log", 0) == 0)
  3507.             break label511;
  3508.           int i3 = 1;
  3509.           localMyOrientationListener.setLogEnabled(i3);
  3510.           if (!this.mSystemReady)
  3511.             continue;
  3512.           int i5 = Settings.System.getInt(localContentResolver, "pointer_location", 0);
  3513.           if (this.mPointerLocationMode == i5)
  3514.             continue;
  3515.           this.mPointerLocationMode = i5;
  3516.           if (i5 == 0)
  3517.             break label518;
  3518.           if (this.mPointerLocationView != null)
  3519.             continue;
  3520.           Context localContext = this.mContext;
  3521.           PointerLocationView localPointerLocationView2 = new PointerLocationView(localContext);
  3522.           this.mPointerLocationView = localPointerLocationView2;
  3523.           this.mPointerLocationView.setPrintCoords(0);
  3524.           localPointerLocationView1 = this.mPointerLocationView;
  3525.           int i6 = Settings.System.getInt(localContentResolver, "screen_off_timeout", 0);
  3526.           this.mLockScreenTimeout = i6;
  3527.           String str = Settings.Secure.getString(localContentResolver, "default_input_method");
  3528.           if ((str == null) || (str.length() <= 0))
  3529.             break label540;
  3530.           i7 = 1;
  3531.           if (this.mHasSoftInput == i7)
  3532.             continue;
  3533.           this.mHasSoftInput = i7;
  3534.           i = 1;
  3535.           if (i == 0)
  3536.             continue;
  3537.           updateRotation(0);
  3538.           if (localPointerLocationView1 != null)
  3539.           {
  3540.             WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams(-1, -1);
  3541.             localLayoutParams.type = 2015;
  3542.             localLayoutParams.flags = 280;
  3543.             localLayoutParams.format = -1;
  3544.             localLayoutParams.setTitle("PointerLocation");
  3545.             ((WindowManager)this.mContext.getSystemService("window")).addView(localPointerLocationView1, localLayoutParams);
  3546.             if (this.mPointerLocationInputChannel != null);
  3547.           }
  3548.         }
  3549.       }
  3550.       try
  3551.       {
  3552.         InputChannel localInputChannel1 = this.mWindowManager.monitorInput("PointerLocationView");
  3553.         this.mPointerLocationInputChannel = localInputChannel1;
  3554.         InputChannel localInputChannel2 = this.mPointerLocationInputChannel;
  3555.         InputHandler localInputHandler = this.mPointerLocationInputHandler;
  3556.         MessageQueue localMessageQueue = this.mHandler.getLooper().getQueue();
  3557.         InputQueue.registerInputChannel(localInputChannel2, localInputHandler, localMessageQueue);
  3558.         if (localObject1 == null)
  3559.           return;
  3560.         if (this.mPointerLocationInputChannel != null)
  3561.         {
  3562.           InputQueue.unregisterInputChannel(this.mPointerLocationInputChannel);
  3563.           this.mPointerLocationInputChannel.dispose();
  3564.           this.mPointerLocationInputChannel = null;
  3565.         }
  3566.         ((WindowManager)this.mContext.getSystemService("window")).removeView((View)localObject1);
  3567.         return;
  3568.         int n = 0;
  3569.         continue;
  3570.         label505: n = 0;
  3571.         continue;
  3572.         label511: int i4 = 0;
  3573.         continue;
  3574.         label518: localObject1 = this.mPointerLocationView;
  3575.         this.mPointerLocationView = null;
  3576.         continue;
  3577.         localObject3 = finally;
  3578.         monitorexit;
  3579.         throw localObject3;
  3580.         label540: i7 = 0;
  3581.       }
  3582.       catch (RemoteException localRemoteException)
  3583.       {
  3584.         while (true)
  3585.           int i8 = Slog.e("WindowManager", "Could not set up input monitoring channel for PointerLocation.", localRemoteException);
  3586.       }
  3587.     }
  3588.   }
  3589.  
  3590.   boolean useSensorForOrientationLp(int paramInt)
  3591.   {
  3592.     int i;
  3593.     if ((paramInt == 4) || (paramInt == 10) || (paramInt == 6) || (paramInt == 7))
  3594.       i = 1;
  3595.     while (true)
  3596.     {
  3597.       return i;
  3598.       if ((this.mAccelerometerDefault != 0) && ((paramInt == 2) || (paramInt == -1)))
  3599.       {
  3600.         i = 1;
  3601.         continue;
  3602.       }
  3603.       if (((this.mCarDockEnablesAccelerometer) && (this.mDockMode == 2)) || ((this.mDeskDockEnablesAccelerometer) && (this.mDockMode == 1) && ((paramInt == 2) || (paramInt == -1) || (paramInt == 5))))
  3604.       {
  3605.         i = 1;
  3606.         continue;
  3607.       }
  3608.       i = 0;
  3609.     }
  3610.   }
  3611.  
  3612.   public void userActivity()
  3613.   {
  3614.     synchronized (this.mScreenLockTimeout)
  3615.     {
  3616.       if (this.mLockScreenTimerActive)
  3617.       {
  3618.         Handler localHandler1 = this.mHandler;
  3619.         Runnable localRunnable2 = this.mScreenLockTimeout;
  3620.         localHandler1.removeCallbacks(localRunnable2);
  3621.         Handler localHandler2 = this.mHandler;
  3622.         Runnable localRunnable3 = this.mScreenLockTimeout;
  3623.         long l = this.mLockScreenTimeout;
  3624.         boolean bool = localHandler2.postDelayed(localRunnable3, l);
  3625.       }
  3626.       return;
  3627.     }
  3628.   }
  3629.  
  3630.   public int windowTypeToLayerLw(int paramInt)
  3631.   {
  3632.     int i;
  3633.     if ((paramInt >= 1) && (paramInt <= 99))
  3634.       i = 2;
  3635.     while (true)
  3636.     {
  3637.       return i;
  3638.       switch (paramInt)
  3639.       {
  3640.       default:
  3641.         String str = "Unknown window type: " + paramInt;
  3642.         int j = Log.e("WindowManager", str);
  3643.         i = 2;
  3644.         break;
  3645.       case 2000:
  3646.         i = 8;
  3647.         break;
  3648.       case 2014:
  3649.         i = 9;
  3650.         break;
  3651.       case 2017:
  3652.         i = 5;
  3653.         break;
  3654.       case 2008:
  3655.         i = 6;
  3656.         break;
  3657.       case 2001:
  3658.         i = 4;
  3659.         break;
  3660.       case 2002:
  3661.         i = 3;
  3662.         break;
  3663.       case 2004:
  3664.         i = 15;
  3665.         break;
  3666.       case 2009:
  3667.         i = 16;
  3668.         break;
  3669.       case 2003:
  3670.         i = 11;
  3671.         break;
  3672.       case 2010:
  3673.         i = 12;
  3674.         break;
  3675.       case 2011:
  3676.         i = 13;
  3677.         break;
  3678.       case 2012:
  3679.         i = 14;
  3680.         break;
  3681.       case 2006:
  3682.         i = 18;
  3683.         break;
  3684.       case 2015:
  3685.         i = 19;
  3686.         break;
  3687.       case 2007:
  3688.         i = 10;
  3689.         break;
  3690.       case 2005:
  3691.         i = 7;
  3692.         break;
  3693.       case 2013:
  3694.         i = 2;
  3695.         break;
  3696.       case 2016:
  3697.         i = 17;
  3698.         break;
  3699.       case 2018:
  3700.         i = 20;
  3701.       }
  3702.     }
  3703.   }
  3704.  
  3705.   class PassHeadsetKey
  3706.     implements Runnable
  3707.   {
  3708.     KeyEvent mKeyEvent;
  3709.  
  3710.     PassHeadsetKey(KeyEvent arg2)
  3711.     {
  3712.       Object localObject;
  3713.       this.mKeyEvent = localObject;
  3714.     }
  3715.  
  3716.     public void run()
  3717.     {
  3718.       if (!ActivityManagerNative.isSystemReady())
  3719.         return;
  3720.       Intent localIntent1 = new Intent("android.intent.action.MEDIA_BUTTON", null);
  3721.       KeyEvent localKeyEvent = this.mKeyEvent;
  3722.       Intent localIntent2 = localIntent1.putExtra("android.intent.extra.KEY_EVENT", localKeyEvent);
  3723.       Context localContext = PhoneWindowManager.this.mContext;
  3724.       BroadcastReceiver localBroadcastReceiver = PhoneWindowManager.this.mBroadcastDone;
  3725.       Handler localHandler = PhoneWindowManager.this.mHandler;
  3726.       String str = null;
  3727.       Bundle localBundle = null;
  3728.       localContext.sendOrderedBroadcast(localIntent1, null, localBroadcastReceiver, localHandler, -1, str, localBundle);
  3729.     }
  3730.   }
  3731.  
  3732.   class MyOrientationListener extends WindowOrientationListener
  3733.   {
  3734.     MyOrientationListener(Context arg2)
  3735.     {
  3736.       super();
  3737.     }
  3738.  
  3739.     public void onOrientationChanged(int paramInt)
  3740.     {
  3741.       try
  3742.       {
  3743.         IWindowManager localIWindowManager = PhoneWindowManager.this.mWindowManager;
  3744.         int i = PhoneWindowManager.this.mFancyRotationAnimation;
  3745.         localIWindowManager.setRotation(paramInt, 0, i);
  3746.         return;
  3747.       }
  3748.       catch (RemoteException localRemoteException)
  3749.       {
  3750.       }
  3751.     }
  3752.   }
  3753.  
  3754.   class SettingsObserver extends ContentObserver
  3755.   {
  3756.     SettingsObserver(Handler arg2)
  3757.     {
  3758.       super();
  3759.     }
  3760.  
  3761.     void observe()
  3762.     {
  3763.       ContentResolver localContentResolver = PhoneWindowManager.this.mContext.getContentResolver();
  3764.       Uri localUri1 = Settings.System.getUriFor("end_button_behavior");
  3765.       localContentResolver.registerContentObserver(localUri1, 0, this);
  3766.       Uri localUri2 = Settings.Secure.getUriFor("incall_power_button_behavior");
  3767.       localContentResolver.registerContentObserver(localUri2, 0, this);
  3768.       Uri localUri3 = Settings.System.getUriFor("accelerometer_rotation");
  3769.       localContentResolver.registerContentObserver(localUri3, 0, this);
  3770.       Uri localUri4 = Settings.System.getUriFor("user_rotation");
  3771.       localContentResolver.registerContentObserver(localUri4, 0, this);
  3772.       Uri localUri5 = Settings.System.getUriFor("screen_off_timeout");
  3773.       localContentResolver.registerContentObserver(localUri5, 0, this);
  3774.       Uri localUri6 = Settings.System.getUriFor("window_orientation_listener_log");
  3775.       localContentResolver.registerContentObserver(localUri6, 0, this);
  3776.       Uri localUri7 = Settings.System.getUriFor("pointer_location");
  3777.       localContentResolver.registerContentObserver(localUri7, 0, this);
  3778.       Uri localUri8 = Settings.Secure.getUriFor("default_input_method");
  3779.       localContentResolver.registerContentObserver(localUri8, 0, this);
  3780.       Uri localUri9 = Settings.System.getUriFor("fancy_rotation_anim");
  3781.       localContentResolver.registerContentObserver(localUri9, 0, this);
  3782.       PhoneWindowManager.this.updateSettings();
  3783.     }
  3784.  
  3785.     public void onChange(boolean paramBoolean)
  3786.     {
  3787.       PhoneWindowManager.this.updateSettings();
  3788.       try
  3789.       {
  3790.         IWindowManager localIWindowManager = PhoneWindowManager.this.mWindowManager;
  3791.         int i = PhoneWindowManager.this.mFancyRotationAnimation;
  3792.         localIWindowManager.setRotation(64536, 0, i);
  3793.         return;
  3794.       }
  3795.       catch (RemoteException localRemoteException)
  3796.       {
  3797.       }
  3798.     }
  3799.   }
  3800. }
  3801.  
  3802. /* Location:           /home/bigrushdog/Desktop/music_mod/classes.dex.dex2jar.jar
  3803.  * Qualified Name:     com.android.internal.policy.impl.PhoneWindowManager
  3804.  * JD-Core Version:    0.6.0
  3805.  */
Advertisement
Add Comment
Please, Sign In to add comment