Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fa30848 authored by Jeff Brown's avatar Jeff Brown Committed by Android Git Automerger
Browse files

am 410bc60a: Merge changes I790820b1,I3fcf3619,Ia0d5a156 into jb-mr1-dev

* commit '410bc60a':
  Enable hardware acceleration for pointer location overlay.
  Disable use of twilight mode for auto-brightness.
  Use new API to override user activity timeout from keyguard.
parents cd781ce2 410bc60a
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -339,6 +339,15 @@ public final class PowerManager {
        return SystemProperties.getBoolean("persist.power.useautobrightadj", false);
        return SystemProperties.getBoolean("persist.power.useautobrightadj", false);
    }
    }


    /**
     * Returns true if the twilight service should be used to adjust screen brightness
     * policy.  This setting is experimental and disabled by default.
     * @hide
     */
    public static boolean useTwilightAdjustmentFeature() {
        return SystemProperties.getBoolean("persist.power.usetwilightadj", false);
    }

    /**
    /**
     * Creates a new wake lock with the specified level and flags.
     * Creates a new wake lock with the specified level and flags.
     * <p>
     * <p>
+6 −1
Original line number Original line Diff line number Diff line
@@ -775,7 +775,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (keyguardShowing) {
        if (keyguardShowing) {
            // since it took two seconds of long press to bring this up,
            // since it took two seconds of long press to bring this up,
            // poke the wake lock so they have some time to see the dialog.
            // poke the wake lock so they have some time to see the dialog.
            mKeyguardMediator.pokeWakelock();
            mKeyguardMediator.userActivity();
        }
        }
    }
    }


@@ -1140,6 +1140,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                    | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                    | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                    | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
                    | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
                    | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN;
            if (ActivityManager.isHighEndGfx()) {
                lp.flags |= WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
                lp.privateFlags |=
                        WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED;
            }
            lp.format = PixelFormat.TRANSLUCENT;
            lp.format = PixelFormat.TRANSLUCENT;
            lp.setTitle("PointerLocation");
            lp.setTitle("PointerLocation");
            WindowManager wm = (WindowManager)
            WindowManager wm = (WindowManager)
+2 −2
Original line number Original line Diff line number Diff line
@@ -234,7 +234,7 @@ public class KeyguardHostView extends KeyguardViewBase {


        public void userActivity(long timeout) {
        public void userActivity(long timeout) {
            if (mViewMediatorCallback != null) {
            if (mViewMediatorCallback != null) {
                mViewMediatorCallback.pokeWakelock(timeout);
                mViewMediatorCallback.userActivity(timeout);
            }
            }
        }
        }


@@ -638,7 +638,7 @@ public class KeyguardHostView extends KeyguardViewBase {
            if (DEBUG) Log.d(TAG, "poking wake lock immediately");
            if (DEBUG) Log.d(TAG, "poking wake lock immediately");
        }
        }
        if (mViewMediatorCallback != null) {
        if (mViewMediatorCallback != null) {
            mViewMediatorCallback.pokeWakelock();
            mViewMediatorCallback.wakeUp();
        }
        }
    }
    }


+2 −0
Original line number Original line Diff line number Diff line
@@ -76,6 +76,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri


                case com.android.internal.R.drawable.ic_lockscreen_unlock_phantom:
                case com.android.internal.R.drawable.ic_lockscreen_unlock_phantom:
                case com.android.internal.R.drawable.ic_lockscreen_unlock:
                case com.android.internal.R.drawable.ic_lockscreen_unlock:
                    mCallback.userActivity(0);
                    mCallback.dismiss(false);
                    mCallback.dismiss(false);
                break;
                break;
            }
            }
@@ -86,6 +87,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri
        }
        }


        public void onGrabbed(View v, int handle) {
        public void onGrabbed(View v, int handle) {
            mCallback.userActivity(0);
            doTransition(mFadeView, 0.0f);
            doTransition(mFadeView, 0.0f);
        }
        }


+2 −0
Original line number Original line Diff line number Diff line
@@ -155,6 +155,8 @@ public class KeyguardViewManager {
                        WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED;
                        WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_HARDWARE_ACCELERATED;
            }
            }
            lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SET_NEEDS_MENU_KEY;
            lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SET_NEEDS_MENU_KEY;
            lp.inputFeatures |= WindowManager.LayoutParams.INPUT_FEATURE_DISABLE_USER_ACTIVITY;
            lp.userActivityTimeout = KeyguardViewMediator.AWAKE_INTERVAL_DEFAULT_MS;
            lp.setTitle(isActivity ? "KeyguardMock" : "Keyguard");
            lp.setTitle(isActivity ? "KeyguardMock" : "Keyguard");
            mWindowLayoutParams = lp;
            mWindowLayoutParams = lp;
            mViewManager.addView(mKeyguardHost, lp);
            mViewManager.addView(mKeyguardHost, lp);
Loading