[Streak 5 Q&A, Help & Troubleshooting] hunderteins:
diffs in services.jar

diff -Nruw MIUI.us_passion_2.2.17/services_decom/com/android/server/HeadsetObserver.jad MIUI.us_streak_2.2.17/services_decom/com/android/server/HeadsetObserver.jad

--- MIUI.us_passion_2.2.17/services_decom/com/android/server/HeadsetObserver.jad	2012-03-10 20:40:39.000000000 +0100

+++ MIUI.us_streak_2.2.17/services_decom/com/android/server/HeadsetObserver.jad	2012-03-10 20:42:04.000000000 +0100

@@ -21,7 +21,7 @@

mContext = context;

mWakeLock = ((PowerManager)context.getSystemService("power")).newWakeLock(1, "HeadsetObserver");

mWakeLock.setReferenceCounted(false);

- startObserving("DEVPATH=/devices/virtual/switch/h2w");

+ startObserving("DEVPATH=/devices/virtual/switch/headset");

init();

}

@@ -41,8 +41,8 @@

i = mHeadsetState;

mPrevHeadsetState = mHeadsetState;

String s1;

- i = Integer.valueOf((new String(ac, 0, (new FileReader("/sys/class/switch/h2w/state")).read(ac, 0, 1024))).trim()).intValue();

- s1 = (new String(ac, 0, (new FileReader("/sys/class/switch/h2w/name")).read(ac, 0, 1024))).trim();

+ i = Integer.valueOf((new String(ac, 0, (new FileReader("/sys/class/switch/headset/state")).read(ac, 0, 1024))).trim()).intValue();

+ s1 = (new String(ac, 0, (new FileReader("/sys/class/switch/headset/name")).read(ac, 0, 1024))).trim();

s = s1;

_L1:

update(s, i);

@@ -168,9 +168,9 @@

private static final int BIT_HEADSET = 1;

private static final int BIT_HEADSET_NO_MIC = 2;

private static final int HEADSETS_WITH_MIC = 1;

- private static final String HEADSET_NAME_PATH = "/sys/class/switch/h2w/name";

- private static final String HEADSET_STATE_PATH = "/sys/class/switch/h2w/state";

- private static final String HEADSET_UEVENT_MATCH = "DEVPATH=/devices/virtual/switch/h2w";

+ private static final String HEADSET_NAME_PATH = "/sys/class/switch/headset/name";

+ private static final String HEADSET_STATE_PATH = "/sys/class/switch/headset/state";

+ private static final String HEADSET_UEVENT_MATCH = "DEVPATH=/devices/virtual/switch/headset";

private static final boolean LOG = true;

private static final int SUPPORTED_HEADSETS = 3;

private static final String TAG = com/android/server/HeadsetObserver.getSimpleName();

diff -Nruw MIUI.us_passion_2.2.17/services_decom/com/android/server/PowerManagerService.jad MIUI.us_streak_2.2.17/services_decom/com/android/server/PowerManagerService.jad

--- MIUI.us_passion_2.2.17/services_decom/com/android/server/PowerManagerService.jad	2012-03-10 20:40:46.000000000 +0100

+++ MIUI.us_streak_2.2.17/services_decom/com/android/server/PowerManagerService.jad	2012-03-10 20:42:11.000000000 +0100

@@ -17,8 +17,7 @@

import com.android.internal.app.IBatteryStats;

import com.android.internal.app.ShutdownThread;

import com.android.server.am.BatteryStatsService;

-import java.io.FileDescriptor;

-import java.io.PrintWriter;

+import java.io.*;

import java.util.*;

// Referenced classes of package com.android.server:

@@ -1142,28 +1141,47 @@

private void enableLightSensor(boolean flag)

{

- if(mSensorManager == null || mLightSensorEnabled == flag) goto _L2; else goto _L1

+ byte abyte0[];

+ FileOutputStream fileoutputstream;

+ abyte0 = new byte[2];

+ fileoutputstream = new FileOutputStream("/sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/mode");

+ Slog.e("PowerManagerService", (new StringBuilder()).append("enableLightSensor ").append(flag).append(" ").append(mUseSoftwareAutoBrightness).toString());

+ abyte0[0] = 109;

+ if(!flag) goto _L2; else goto _L1

_L1:

+ int i = 53;

+_L7:

+ abyte0[1] = (byte)i;

+ fileoutputstream.write(abyte0);

+ fileoutputstream.close();

+_L9:

+ if(mSensorManager == null || mLightSensorEnabled == flag) goto _L4; else goto _L3

+_L3:

long l;

mLightSensorEnabled = flag;

l = Binder.clearCallingIdentity();

- if(!flag) goto _L4; else goto _L3

-_L3:

+ if(!flag) goto _L6; else goto _L5

+_L5:

mSensorManager.registerListener(mLightListener, mLightSensor, 3);

-_L6:

+_L8:

Binder.restoreCallingIdentity(l);

-_L2:

- return;

_L4:

+ return;

+_L2:

+ i = 50;

+ goto _L7

+_L6:

lightFilterStop();

mSensorManager.unregisterListener(mLightListener);

mHandler.removeCallbacks(mAutoBrightnessTask);

- if(true) goto _L6; else goto _L5

-_L5:

+ goto _L8

+ Exception exception1;

+ exception1;

+ Binder.restoreCallingIdentity(l);

+ throw exception1;

Exception exception;

exception;

- Binder.restoreCallingIdentity(l);

- throw exception;

+ goto _L9

}

private void enableProximityLockLocked()

@@ -1820,6 +1838,11 @@

flag = true;

else

flag = false;

+ if(mAutoBrightessEnabled != flag)

+ {

+ mAutoBrightessEnabled = flag;

+ enableLightSensor(mAutoBrightessEnabled);

+ }

if(mUseSoftwareAutoBrightness && mAutoBrightessEnabled != flag)

{

mAutoBrightessEnabled = flag;

@@ -1895,6 +1918,7 @@

else

l = 0L;

mLastScreenOnTime = l;

+ enableLightSensor(mAutoBrightessEnabled);

if(!mUseSoftwareAutoBrightness) goto _L2; else goto _L3

_L3:

enableLightSensor(flag);

@@ -2870,6 +2894,7 @@

mUnplugTurnsOnScreen = resources.getBoolean(0x10d0007);

mFlashlightAffectsLightSensor = resources.getBoolean(0x10d0016);

mUseSoftwareAutoBrightness = resources.getBoolean(0x10d0005);

+ mUseSoftwareAutoBrightness = false;

if(mUseSoftwareAutoBrightness)

{

mAutoBrightnessLevels = resources.getIntArray(0x1070019);

@@ -3374,6 +3399,7 @@

long l;

mSensorManager = new SensorManager(mHandlerThread.getLooper());

mProximitySensor = mSensorManager.getDefaultSensor(8);

+ enableLightSensor(true);

if(mUseSoftwareAutoBrightness)

{

mLightSensor = mSensorManager.getDefaultSensor(5);