[Samsung Galaxy S 5 Unified Development] rompnit:
Part 2

Almost there!! Search for

.method private updatePowerState()V

And REPLACE THE ENTIRE METHOD WITH THE FOLLOWING

.method private updatePowerState()V
.locals 12

const/4 v7, 0x1

const/4 v8, 0x0

const/4 v0, 0x0

iget-boolean v4, p0, Lcom/android/server/power/DisplayPowerController;->mTwilightChanged:Z

const/4 v5, 0x0

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mTwilightChanged:Z

iget-object v9, p0, Lcom/android/server/power/DisplayPowerController;->mLock:Ljava/lang/Object;

monitor-enter v9

const/4 v6, 0x0

:try_start_0
iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingUpdatePowerStateLocked:Z

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;

if-nez v6, :cond_1

monitor-exit v9

:cond_0
:goto_0
return-void

:cond_1
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

if-nez v6, :cond_c

new-instance v6, Lcom/android/server/power/DisplayPowerRequest;

iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;

invoke-direct {v6, v10}, Lcom/android/server/power/DisplayPowerRequest;-><init>(Lcom/android/server/power/DisplayPowerRequest;)V

iput-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z

const/4 v6, 0x0

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

const/4 v6, 0x0

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z

const/4 v6, 0x0

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z

const/4 v0, 0x1

:cond_2
:goto_1
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mDisplayReadyLocked:Z

if-nez v6, :cond_10

move v1, v7

:goto_2
monitor-exit v9
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0

if-eqz v0, :cond_3

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->initialize()V

:cond_3
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z

if-nez v6, :cond_4

iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I

if-ne v6, v7, :cond_4

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

if-eqz v6, :cond_4

iput-boolean v7, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z

:cond_4
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z

if-eqz v6, :cond_5

iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I

if-nez v6, :cond_5

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mWaitProximityToggled:Z

:cond_5
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximitySensor:Landroid/hardware/Sensor;

if-eqz v6, :cond_18

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->useProximitySensor:Z

if-eqz v6, :cond_15

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

if-nez v6, :cond_11

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z

move-result v6

if-nez v6, :cond_11

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->lastGoToSleepReason:I

if-nez v6, :cond_11

invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V

invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

:cond_6
:goto_3
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mLightSensor:Landroid/hardware/Sensor;

if-eqz v6, :cond_7

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mTiltSensor:Landroid/hardware/Sensor;

if-eqz v6, :cond_7

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->useAutoBrightness:Z

if-eqz v6, :cond_19

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z

move-result v6

if-eqz v6, :cond_19

move v6, v7

:goto_4
invoke-direct {p0, v6, v4}, Lcom/android/server/power/DisplayPowerController;->setLightSensorEnabled(ZZ)V

:cond_7
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z

move-result v6

if-eqz v6, :cond_1d

iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenAutoBrightness:I

if-ltz v6, :cond_1a

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mLightSensorEnabled:Z

if-eqz v6, :cond_1a

iget v3, p0, Lcom/android/server/power/DisplayPowerController;->mScreenAutoBrightness:I

iget-boolean v2, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z

iput-boolean v7, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z

:goto_5
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

const/4 v9, 0x2

if-ne v6, v9, :cond_8

iput v3, p0, Lcom/android/server/power/DisplayPowerController;->mScreenBrightnessOnCover:I

:cond_8
invoke-direct {p0, v3}, Lcom/android/server/power/DisplayPowerController;->getFinalBrightness(I)I

move-result v3

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

if-ne v6, v7, :cond_1b

add-int/lit8 v6, v3, -0xa

iget v9, p0, Lcom/android/server/power/DisplayPowerController;->mScreenBrightnessDimConfig:I

invoke-static {v6, v9}, Ljava/lang/Math;->min(II)I

move-result v3

const/4 v2, 0x0

:cond_9
:goto_6
invoke-direct {p0, v3}, Lcom/android/server/power/DisplayPowerController;->clampScreenBrightness(I)I

move-result v9

if-eqz v2, :cond_1c

const/16 v6, 0x1f4

:goto_7
invoke-direct {p0, v9, v6}, Lcom/android/server/power/DisplayPowerController;->animateScreenBrightness(II)V

:goto_8
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

if-nez v6, :cond_a

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z

move-result v6

if-eqz v6, :cond_23

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z

move-result v6

if-nez v6, :cond_a

invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z

if-eqz v6, :cond_1e

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F

move-result v6

const v10, 0x0

cmpl-float v6, v6, v10

if-nez v6, :cond_1e

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->blockScreenOn()V

:cond_a
:goto_9
if-eqz v1, :cond_0

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnWasBlocked:Z

if-nez v6, :cond_0

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z

move-result v6

if-nez v6, :cond_0

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z

move-result v6

if-nez v6, :cond_0

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

iget-object v7, p0, Lcom/android/server/power/DisplayPowerController;->mCleanListener:Ljava/lang/Runnable;

invoke-virtual {v6, v7}, Lcom/android/server/power/DisplayPowerState;->waitUntilClean(Ljava/lang/Runnable;)Z

move-result v6

if-eqz v6, :cond_0

iget-object v7, p0, Lcom/android/server/power/DisplayPowerController;->mLock:Ljava/lang/Object;

monitor-enter v7

:try_start_1
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z

if-nez v6, :cond_b

const/4 v6, 0x1

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mDisplayReadyLocked:Z

sget-boolean v6, Lcom/android/server/power/DisplayPowerController;->DEBUG:Z

if-eqz v6, :cond_b

const-string v6, "DisplayPowerController"

const-string v8, "Display ready!"

invoke-static {v6, v8}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

:cond_b
monitor-exit v7
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnStateChangedWithWakelock()V

goto/16 :goto_0

:cond_c
:try_start_2
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z

if-eqz v6, :cond_2

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenAutoBrightnessAdjustment:F

iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;

iget v10, v10, Lcom/android/server/power/DisplayPowerRequest;->screenAutoBrightnessAdjustment:F

cmpl-float v6, v6, v10

if-eqz v6, :cond_d

const/4 v4, 0x1

:cond_d
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->autoBrightnessForEbookOnly:Z

iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v10, v10, Lcom/android/server/power/DisplayPowerRequest;->autoBrightnessForEbookOnly:Z

if-eq v6, v10, :cond_e

const-string v6, "DisplayPowerController"

new-instance v10, Ljava/lang/StringBuilder;

invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V

const-string v11, "[DAB] updatePowerState : autoBrightnessForEbookOnly : "

invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v10

iget-object v11, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v11, v11, Lcom/android/server/power/DisplayPowerRequest;->autoBrightnessForEbookOnly:Z

invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

move-result-object v10

invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v10

invoke-static {v6, v10}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

const/4 v4, 0x1

:cond_e
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

if-ne v6, v7, :cond_f

move v5, v7

:goto_a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget-object v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestLocked:Lcom/android/server/power/DisplayPowerRequest;

invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerRequest;->copyFrom(Lcom/android/server/power/DisplayPowerRequest;)V

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z

iget-boolean v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z

or-int/2addr v6, v10

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z

const/4 v6, 0x0

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingWaitForNegativeProximityLocked:Z

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

iget-boolean v10, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z

or-int/2addr v6, v10

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

const/4 v6, 0x0

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingScreenOnEvenThoughProximityPositiveLocked:Z

const/4 v6, 0x0

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mPendingRequestChangedLocked:Z

const/4 v6, 0x0

iput-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mDisplayReadyLocked:Z

goto/16 :goto_1

:catchall_0
move-exception v6

monitor-exit v9
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0

throw v6

:cond_f
move v5, v8

goto :goto_a

:cond_10
move v1, v8

goto/16 :goto_2

:cond_11
invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V

iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I

if-ne v6, v7, :cond_14

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

if-nez v6, :cond_12

iput-boolean v7, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityPositiveWithWakelock()V

goto/16 :goto_3

:cond_12
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

if-eqz v6, :cond_6

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

if-eqz v6, :cond_6

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

if-eqz v6, :cond_13

const-string v6, "DisplayPowerController"

const-string v9, "[sensor] proximity : mScreenOnEvenThoughProximityPositive is true"

invoke-static {v6, v9}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

:cond_13
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V

goto/16 :goto_3

:cond_14
iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I

if-nez v6, :cond_6

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

if-eqz v6, :cond_6

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V

goto/16 :goto_3

:cond_15
iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z

if-eqz v6, :cond_17

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

iget v6, p0, Lcom/android/server/power/DisplayPowerController;->mProximity:I

if-ne v6, v7, :cond_16

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v6, v6, Lcom/android/server/power/DisplayPowerRequest;->screenState:I

invoke-static {v6}, Lcom/android/server/power/DisplayPowerController;->wantScreenOn(I)Z

move-result v6

if-eqz v6, :cond_6

:cond_16
invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z

goto/16 :goto_3

:cond_17
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOnEvenThoughProximityPositive:Z

invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setProximitySensorEnabled(Z)V

iget-boolean v6, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

if-eqz v6, :cond_6

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mScreenOffBecauseOfProximity:Z

invoke-direct {p0, v7}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendOnProximityNegativeWithWakelock()V

goto/16 :goto_3

:cond_18
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mWaitingForNegativeProximity:Z

goto/16 :goto_3

:cond_19
move v6, v8

goto/16 :goto_4

:cond_1a
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget v3, v6, Lcom/android/server/power/DisplayPowerRequest;->screenBrightness:I

const/4 v2, 0x0

iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z

goto/16 :goto_5

:cond_1b
if-eqz v5, :cond_9

const/4 v2, 0x0

goto/16 :goto_6

:cond_1c
const/16 v6, 0x7d0

goto/16 :goto_7

:cond_1d
iput-boolean v8, p0, Lcom/android/server/power/DisplayPowerController;->mUsingScreenAutoBrightness:Z

goto/16 :goto_8

:cond_1e
invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V

iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOn:I

if-nez v10, :cond_1f

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

const/high16 v7, 0x3f80

invoke-virtual {v6, v7}, Lcom/android/server/power/DisplayPowerState;->setElectronBeamLevel(F)V

invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V

goto/16 :goto_9

:cond_1f
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z

move-result v6

if-nez v6, :cond_a

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F

move-result v6

const/high16 v7, 0x3f80

cmpl-float v6, v6, v7

if-nez v6, :cond_20

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->dismissElectronBeam()V

goto/16 :goto_9

:cond_20
const v6, 0x2

if-eq v6, v10, :cond_21

const v10, 0x0

:cond_21
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z

move-result v6

if-eqz v6, :cond_22

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V

goto/16 :goto_9

:cond_22
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V

goto/16 :goto_9

:cond_23
iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I

if-nez v10, :cond_24

invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerRequest:Lcom/android/server/power/DisplayPowerRequest;

iget-boolean v6, v6, Lcom/android/server/power/DisplayPowerRequest;->blockScreenOn:Z

if-nez v6, :cond_a

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->unblockScreenOn()V

goto/16 :goto_9

:cond_24
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOnAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z

move-result v6

if-nez v6, :cond_a

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->isStarted()Z

move-result v6

if-nez v6, :cond_a

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->getElectronBeamLevel()F

move-result v6

const v10, 0x0

cmpl-float v6, v6, v10

if-nez v6, :cond_25

invoke-direct {p0, v8}, Lcom/android/server/power/DisplayPowerController;->setScreenOn(Z)V

goto/16 :goto_9

:cond_25
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

iget v10, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOff:I

invoke-virtual {v6, v10}, Lcom/android/server/power/DisplayPowerState;->prepareElectronBeam(I)Z

move-result v6

if-eqz v6, :cond_26

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mPowerState:Lcom/android/server/power/DisplayPowerState;

invoke-virtual {v6}, Lcom/android/server/power/DisplayPowerState;->isScreenOn()Z

move-result v6

if-eqz v6, :cond_26

iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->start()V

goto/16 :goto_9

:cond_26
iget-object v6, p0, Lcom/android/server/power/DisplayPowerController;->mElectronBeamOffAnimator:Landroid/animation/ObjectAnimator;

invoke-virtual {v6}, Landroid/animation/ObjectAnimator;->end()V

goto/16 :goto_9

:catchall_1
move-exception v6

:try_start_3
monitor-exit v7
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_1

throw v6
.end method

Last step in this smali :)

Search for

.method public requestPowerState(Lcom/android/server/power/DisplayPowerRequest;ZZ)Z

And place the following methods DIRECTLY ABOVE it

.method public onAnimationCancel(Landroid/animation/Animator;)V
.locals 0

return-void
.end method

.method public onAnimationEnd(Landroid/animation/Animator;)V
.locals 0

invoke-direct {p0}, Lcom/android/server/power/DisplayPowerController;->sendUpdatePowerState()V

return-void
.end method

.method public onAnimationRepeat(Landroid/animation/Animator;)V
.locals 0

return-void
.end method

.method public onAnimationStart(Landroid/animation/Animator;)V
.locals 0

return-void
.end method

That's all for the services.jar!

Finally you must add this value to your build.prop

#CRT Mod
persist.sys.screen_off=crt

You can use any of the following values for off : fade, crt, none

I have also attached both the original and edited smali for diffing out ;)

Enjoy!!