Skip to content

Commit

Permalink
Merge branch '3.6.x_dev' into 3.6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
dbergloev committed Dec 21, 2015
2 parents e194642 + 81aea0d commit fb72d7a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions projects/xposedAdditions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {

minSdkVersion 9
targetSdkVersion 22
versionCode 74
versionName "3.6.2"
versionCode 75
versionName "3.6.3"
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,17 @@ protected IMediatorSetup(ReflectClass pwm, XServiceManager xServiceManager) {
* Get the Power Management tools
*/
mPowerManager = ReflectClass.fromReceiver(((Context) mContext.getReceiver()).getSystemService(Context.POWER_SERVICE));
mPowerManagerService = (ReflectClass) mPowerManager.findField("mService").getValue(Result.INSTANCE);

try {
mPowerManagerService = (ReflectClass) mPowerManager.findField("mService").getValue(Result.INSTANCE);

} catch (ReflectException e) {
/*
* This is a work-around for devices that is heavily modified, like Amazon Fire Phone where the above field for some reason returns NULL
*/
mPowerManagerService = ReflectClass.fromName("android.os.IPowerManager").bindInterface("power");
}

mWakelock = ((PowerManager) mPowerManager.getReceiver()).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "HookedPhoneWindowManager");

/*
Expand Down

0 comments on commit fb72d7a

Please sign in to comment.