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

Commit 0b23c143 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru
Browse files

manual merge

Change-Id: I0a81f92831dabc518cfd33b40ea93fd496a1a01c
parents 13ec98f3 099fc362
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -144,6 +144,13 @@ public class ActivityManager {
     */
    public static final int RECENT_WITH_EXCLUDED = 0x0001;
    
    /**
     * @hide
     * TODO: Make this public.  Provides a list that does not contain any
     * recent tasks that currently are not available to the user.
     */
    public static final int RECENT_IGNORE_UNAVAILABLE = 0x0002;
    
    /**
     * Return a list of the tasks that the user has recently launched, with
     * the most recent being first and older ones after in order.
+31 −17
Original line number Diff line number Diff line
@@ -4659,13 +4659,16 @@ public class WebView extends AbsoluteLayout
                        ted.mY = contentY;
                        ted.mMetaState = ev.getMetaState();
                        ted.mReprocess = mDeferTouchProcess;
                        mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                        if (mDeferTouchProcess) {
                            // still needs to set them for compute deltaX/Y
                            mLastTouchX = x;
                            mLastTouchY = y;
                            ted.mViewX = x;
                            ted.mViewY = y;
                            mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                            break;
                        }
                        mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                        if (!inFullScreenMode()) {
                            mPrivateHandler.sendMessageDelayed(mPrivateHandler
                                    .obtainMessage(PREVENT_DEFAULT_TIMEOUT,
@@ -4691,17 +4694,20 @@ public class WebView extends AbsoluteLayout
                // pass the touch events from UI thread to WebCore thread
                if (shouldForwardTouchEvent() && mConfirmMove && (firstMove
                        || eventTime - mLastSentTouchTime > mCurrentTouchInterval)) {
                    mLastSentTouchTime = eventTime;
                    TouchEventData ted = new TouchEventData();
                    ted.mAction = action;
                    ted.mX = contentX;
                    ted.mY = contentY;
                    ted.mMetaState = ev.getMetaState();
                    ted.mReprocess = mDeferTouchProcess;
                    mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                    mLastSentTouchTime = eventTime;
                    if (mDeferTouchProcess) {
                        ted.mViewX = x;
                        ted.mViewY = y;
                        mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                        break;
                    }
                    mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                    if (firstMove && !inFullScreenMode()) {
                        mPrivateHandler.sendMessageDelayed(mPrivateHandler
                                .obtainMessage(PREVENT_DEFAULT_TIMEOUT,
@@ -4866,6 +4872,10 @@ public class WebView extends AbsoluteLayout
                    ted.mY = contentY;
                    ted.mMetaState = ev.getMetaState();
                    ted.mReprocess = mDeferTouchProcess;
                    if (mDeferTouchProcess) {
                        ted.mViewX = x;
                        ted.mViewY = y;
                    }
                    mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                }
                mLastTouchUpTime = eventTime;
@@ -4880,6 +4890,10 @@ public class WebView extends AbsoluteLayout
                            ted.mY = contentY;
                            ted.mMetaState = ev.getMetaState();
                            ted.mReprocess = mDeferTouchProcess;
                            if (mDeferTouchProcess) {
                                ted.mViewX = x;
                                ted.mViewY = y;
                            }
                            mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                        } else if (mPreventDefault != PREVENT_DEFAULT_YES){
                            doDoubleTap();
@@ -6156,6 +6170,10 @@ public class WebView extends AbsoluteLayout
                        // simplicity for now, we don't set it.
                        ted.mMetaState = 0;
                        ted.mReprocess = mDeferTouchProcess;
                        if (mDeferTouchProcess) {
                            ted.mViewX = mLastTouchX;
                            ted.mViewY = mLastTouchY;
                        }
                        mWebViewCore.sendMessage(EventHub.TOUCH_EVENT, ted);
                    } else if (mPreventDefault != PREVENT_DEFAULT_YES) {
                        mTouchMode = TOUCH_DONE_MODE;
@@ -6452,31 +6470,27 @@ public class WebView extends AbsoluteLayout
                        TouchEventData ted = (TouchEventData) msg.obj;
                        switch (ted.mAction) {
                            case MotionEvent.ACTION_DOWN:
                                mLastDeferTouchX = contentToViewX(ted.mX)
                                        - mScrollX;
                                mLastDeferTouchY = contentToViewY(ted.mY)
                                        - mScrollY;
                                mLastDeferTouchX = ted.mViewX;
                                mLastDeferTouchY = ted.mViewY;
                                mDeferTouchMode = TOUCH_INIT_MODE;
                                break;
                            case MotionEvent.ACTION_MOVE: {
                                // no snapping in defer process
                                int x = contentToViewX(ted.mX) - mScrollX;
                                int y = contentToViewY(ted.mY) - mScrollY;
                                if (mDeferTouchMode != TOUCH_DRAG_MODE) {
                                    mDeferTouchMode = TOUCH_DRAG_MODE;
                                    mLastDeferTouchX = x;
                                    mLastDeferTouchY = y;
                                    mLastDeferTouchX = ted.mViewX;
                                    mLastDeferTouchY = ted.mViewY;
                                    startDrag();
                                }
                                int deltaX = pinLocX((int) (mScrollX
                                        + mLastDeferTouchX - x))
                                        + mLastDeferTouchX - ted.mViewX))
                                        - mScrollX;
                                int deltaY = pinLocY((int) (mScrollY
                                        + mLastDeferTouchY - y))
                                        + mLastDeferTouchY - ted.mViewY))
                                        - mScrollY;
                                doDrag(deltaX, deltaY);
                                if (deltaX != 0) mLastDeferTouchX = x;
                                if (deltaY != 0) mLastDeferTouchY = y;
                                if (deltaX != 0) mLastDeferTouchX = ted.mViewX;
                                if (deltaY != 0) mLastDeferTouchY = ted.mViewY;
                                break;
                            }
                            case MotionEvent.ACTION_UP:
@@ -6489,8 +6503,8 @@ public class WebView extends AbsoluteLayout
                                break;
                            case WebViewCore.ACTION_DOUBLETAP:
                                // doDoubleTap() needs mLastTouchX/Y as anchor
                                mLastTouchX = contentToViewX(ted.mX) - mScrollX;
                                mLastTouchY = contentToViewY(ted.mY) - mScrollY;
                                mLastTouchX = ted.mViewX;
                                mLastTouchY = ted.mViewY;
                                doDoubleTap();
                                mDeferTouchMode = TOUCH_DONE_MODE;
                                break;
+2 −0
Original line number Diff line number Diff line
@@ -708,6 +708,8 @@ final class WebViewCore {
        int mY;
        int mMetaState;
        boolean mReprocess;
        float mViewX;
        float mViewY;
    }

    static class GeolocationPermissionsData {
+33 −30
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
    private TextView mStatus1;
    private TextView mStatus2;
    private TextView mScreenLocked;
    private TextView mEmergencyCallText;
    private Button mEmergencyCallButton;

    // current configuration state of keyboard and display
@@ -203,19 +204,23 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
        mStatus1 = (TextView) findViewById(R.id.status1);
        mStatus2 = (TextView) findViewById(R.id.status2);

        mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
        mEmergencyCallButton.setText(R.string.lockscreen_emergency_call);
        mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
        mScreenLocked = (TextView) findViewById(R.id.screenLocked);
        mSelector = (SlidingTab) findViewById(R.id.tab_selector);
        mSelector.setHoldAfterTrigger(true, false);
        mSelector.setLeftHintText(R.string.lockscreen_unlock_label);

        mEmergencyCallText = (TextView) findViewById(R.id.emergencyCallText);
        mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
        mEmergencyCallButton.setText(R.string.lockscreen_emergency_call);

        mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
        mEmergencyCallButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                mCallback.takeEmergencyCallAction();
            }
        });


        setFocusable(true);
        setFocusableInTouchMode(true);
        setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
@@ -269,7 +274,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM

        refreshBatteryStringAndIcon();
        refreshAlarmDisplay();
        mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);

        mTimeFormat = DateFormat.getTimeFormat(getContext());
        mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
@@ -340,8 +344,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
     * @param iconResourceId The left hand icon.
     */
    private void toastMessage(final TextView textView, final String text, final int color, final int iconResourceId) {
        if (DBG) android.util.Log.d("LockScreen", "toastMessage(text=" + text +", color=" + color + ")");

        if (mPendingR1 != null) {
            textView.removeCallbacks(mPendingR1);
            mPendingR1 = null;
@@ -499,9 +501,11 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
     * Update the layout to match the current status.
     */
    private void updateLayout(Status status) {
        // The emergency call button appears where the carrier would
        // ordinarily be shown, so if one is VISIBLE the other must be
        // INVISIBLE.
        // The emergency call button no longer appears on this screen.
        if (DBG) Log.d(TAG, "updateLayout: status=" + status);

        mEmergencyCallButton.setVisibility(View.GONE); // in almost all cases

        switch (status) {
            case Normal:
                // text
@@ -509,12 +513,14 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
                        getCarrierString(
                                mUpdateMonitor.getTelephonyPlmn(),
                                mUpdateMonitor.getTelephonySpn()));
//                mScreenLocked.setText(R.string.lockscreen_screen_locked);

                // Empty now, but used for sliding tab feedback
                mScreenLocked.setText("");

                // layout
                mScreenLocked.setVisibility(View.VISIBLE);
                mSelector.setVisibility(View.VISIBLE);
                mEmergencyCallButton.setVisibility(View.GONE);
                mEmergencyCallText.setVisibility(View.GONE);
                break;
            case NetworkLocked:
                // The carrier string shows both sim card status (i.e. No Sim Card) and
@@ -528,34 +534,31 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
                // layout
                mScreenLocked.setVisibility(View.VISIBLE);
                mSelector.setVisibility(View.VISIBLE);
                mEmergencyCallButton.setVisibility(View.GONE);
                mEmergencyCallText.setVisibility(View.GONE);
                break;
            case SimMissing:
                // text
                mCarrier.setText("");
                mScreenLocked.setText(
                        getCarrierString(
                                mUpdateMonitor.getTelephonyPlmn(),
                                getContext().getText(R.string.lockscreen_missing_sim_message_short)));
                // previously shown here: lockscreen_instructions_when_pattern_disabled
                mCarrier.setText(R.string.lockscreen_missing_sim_message_short);
                mScreenLocked.setText(R.string.lockscreen_missing_sim_instructions);

                // layout
                mScreenLocked.setVisibility(View.VISIBLE);
                mSelector.setVisibility(View.VISIBLE);
                mEmergencyCallButton.setVisibility(View.VISIBLE);
                mEmergencyCallText.setVisibility(View.VISIBLE);
                // do not need to show the e-call button; user may unlock
                break;
            case SimMissingLocked:
                // text
                mCarrier.setText("");
                mScreenLocked.setText(
                mCarrier.setText(
                        getCarrierString(
                                mUpdateMonitor.getTelephonyPlmn(),
                                getContext().getText(R.string.lockscreen_missing_sim_message_short)));
                // previously shown here: lockscreen_missing_sim_instructions
                mScreenLocked.setText(R.string.lockscreen_missing_sim_instructions);

                // layout
                mScreenLocked.setVisibility(View.VISIBLE);
                mSelector.setVisibility(View.GONE);
                mSelector.setVisibility(View.GONE); // cannot unlock
                mEmergencyCallText.setVisibility(View.VISIBLE);
                mEmergencyCallButton.setVisibility(View.VISIBLE);
                break;
            case SimLocked:
@@ -568,20 +571,20 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
                // layout
                mScreenLocked.setVisibility(View.INVISIBLE);
                mSelector.setVisibility(View.VISIBLE);
                mEmergencyCallButton.setVisibility(View.GONE);
                mEmergencyCallText.setVisibility(View.GONE);
                break;
            case SimPukLocked:
                // text
                mCarrier.setText("");
                mScreenLocked.setText(
                mCarrier.setText(
                        getCarrierString(
                                mUpdateMonitor.getTelephonyPlmn(),
                                getContext().getText(R.string.lockscreen_sim_puk_locked_message)));
                // previously shown here: lockscreen_sim_puk_locked_instructions);
                mScreenLocked.setText(R.string.lockscreen_sim_puk_locked_instructions);

                // layout
                mScreenLocked.setVisibility(View.VISIBLE);
                mSelector.setVisibility(View.GONE);
                mSelector.setVisibility(View.GONE); // cannot unlock
                mEmergencyCallText.setVisibility(View.VISIBLE);
                mEmergencyCallButton.setVisibility(View.VISIBLE);
                break;
        }
+40 −21
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ public class WindowManagerService extends IWindowManager.Stub
    static final boolean DEBUG_STARTING_WINDOW = false;
    static final boolean DEBUG_REORDER = false;
    static final boolean DEBUG_WALLPAPER = false;
    static final boolean DEBUG_FREEZE = false;
    static final boolean SHOW_TRANSACTIONS = false;
    static final boolean HIDE_STACK_CRAWLS = true;
    static final boolean MEASURE_LATENCY = false;
@@ -4418,7 +4419,8 @@ public class WindowManagerService extends IWindowManager.Stub
            final int N = mWindows.size();
            for (int i=0; i<N; i++) {
                WindowState w = (WindowState)mWindows.get(i);
                if (w.isVisibleLw() && !w.mObscured && !w.isDrawnLw()) {
                if (w.isVisibleLw() && !w.mObscured
                        && (w.mOrientationChanging || !w.isDrawnLw())) {
                    return;
                }
            }
@@ -7925,7 +7927,7 @@ public class WindowManagerService extends IWindowManager.Stub
            final AppWindowToken atoken = mAppToken;
            return mSurface != null && !mAttachedHidden
                    && (atoken == null ? mPolicyVisibility : !atoken.hiddenRequested)
                    && !mDrawPending && !mCommitDrawPending
                    && (mOrientationChanging || (!mDrawPending && !mCommitDrawPending))
                    && !mExiting && !mDestroying;
        }

@@ -8029,12 +8031,14 @@ public class WindowManagerService extends IWindowManager.Stub

        /**
         * Returns true if the window has a surface that it has drawn a
         * complete UI in to.
         * complete UI in to.  Note that this returns true if the orientation
         * is changing even if the window hasn't redrawn because we don't want
         * to stop things from executing during that time.
         */
        public boolean isDrawnLw() {
            final AppWindowToken atoken = mAppToken;
            return mSurface != null && !mDestroying
                && !mDrawPending && !mCommitDrawPending;
                && (mOrientationChanging || (!mDrawPending && !mCommitDrawPending));
        }

        public boolean fillsScreenLw(int screenWidth, int screenHeight,
@@ -10292,6 +10296,12 @@ public class WindowManagerService extends IWindowManager.Stub
                    if (w.mAttachedHidden || !w.isReadyForDisplay()) {
                        if (!w.mLastHidden) {
                            //dump();
                            if (DEBUG_CONFIGURATION) Slog.v(TAG, "Window hiding: waitingToShow="
                                    + w.mRootToken.waitingToShow + " polvis="
                                    + w.mPolicyVisibility + " atthid="
                                    + w.mAttachedHidden + " tokhid="
                                    + w.mRootToken.hidden + " vis="
                                    + w.mViewVisibility);
                            w.mLastHidden = true;
                            if (SHOW_TRANSACTIONS) logSurface(w,
                                    "HIDE (performLayout)", null);
@@ -10687,6 +10697,10 @@ public class WindowManagerService extends IWindowManager.Stub
        } else if (animating) {
            requestAnimationLocked(currentTime+(1000/60)-SystemClock.uptimeMillis());
        }
        
        if (DEBUG_FREEZE) Slog.v(TAG, "Layout: mDisplayFrozen=" + mDisplayFrozen
                + " holdScreen=" + holdScreen);
        if (!mDisplayFrozen) {
            mQueue.setHoldScreenLocked(holdScreen != null);
            if (screenBrightness < 0 || screenBrightness > 1.0f) {
                mPowerManager.setScreenBrightnessOverride(-1);
@@ -10705,6 +10719,7 @@ public class WindowManagerService extends IWindowManager.Stub
                Message m = mH.obtainMessage(H.HOLD_SCREEN_CHANGED, holdScreen);
                mH.sendMessage(m);
            }
        }

        if (mTurnOnScreen) {
            if (DEBUG_VISIBILITY) Slog.v(TAG, "Turning screen on after layout!");
@@ -10980,6 +10995,8 @@ public class WindowManagerService extends IWindowManager.Stub
            mFreezeGcPending = now;
        }

        if (DEBUG_FREEZE) Slog.v(TAG, "*** FREEZING DISPLAY", new RuntimeException());
        
        mDisplayFrozen = true;
        if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) {
            mNextAppTransition = WindowManagerPolicy.TRANSIT_UNSET;
@@ -11003,6 +11020,8 @@ public class WindowManagerService extends IWindowManager.Stub
            return;
        }
        
        if (DEBUG_FREEZE) Slog.v(TAG, "*** UNFREEZING DISPLAY", new RuntimeException());
        
        mDisplayFrozen = false;
        mH.removeMessages(H.APP_FREEZE_TIMEOUT);
        if (PROFILE_ORIENTATION) {
Loading