Projects >> platform_frameworks_base >>8b71943942941d4404be2758b1ac817f1692264f

Chunk
Conflicting content
     * affect the power state of the device, for example, the power keys.
     * Generally, it's best to keep as little as possible in the queue thread
     * because it's the most fragile.
<<<<<<< HEAD
     * @param event The key event.
=======
     * @param whenNanos The event time in uptime nanoseconds.
     * @param action The key event action.
     * @param flags The key event flags.
     * @param keyCode The key code.
     * @param scanCode The key's scan code.
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
     * @param policyFlags The policy flags associated with the key.
     * @param isScreenOn True if the screen is already on
     *
Solution content
     * affect the power state of the device, for example, the power keys.
     * Generally, it's best to keep as little as possible in the queue thread
     * because it's the most fragile.
     * @param event The key event.
     * @param policyFlags The policy flags associated with the key.
     * @param isScreenOn True if the screen is already on
     *
File
WindowManagerPolicy.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
     * @return The bitwise or of the {@link #ACTION_PASS_TO_USER},
     *          {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags.
     */
<<<<<<< HEAD
    public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn);
=======
    public int interceptKeyBeforeQueueing(long whenNanos, int action, int flags,
            int keyCode, int scanCode, int policyFlags, boolean isScreenOn);
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
    
    /**
     * Called from the input dispatcher thread before a key is dispatched to a window.
Solution content
     * @return The bitwise or of the {@link #ACTION_PASS_TO_USER},
     *          {@link #ACTION_POKE_USER_ACTIVITY} and {@link #ACTION_GO_TO_SLEEP} flags.
     */
    public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn);
    
    /**
     * Called from the input dispatcher thread before a key is dispatched to a window.
File
WindowManagerPolicy.java
Developer's decision
Version 1
Kind of conflict
Method interface
Chunk
Conflicting content
     * 
     * @param win The window that currently has focus.  This is where the key
     *            event will normally go.
<<<<<<< HEAD
     * @param event The key event.
=======
     * @param action The key event action.
     * @param flags The key event flags.
     * @param keyCode The key code.
     * @param scanCode The key's scan code.
     * @param metaState bit mask of meta keys that are held.
     * @param repeatCount Number of times a key down has repeated.
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
     * @param policyFlags The policy flags associated with the key.
     * @return Returns true if the policy consumed the event and it should
     * not be further dispatched.
Solution content
     * 
     * @param win The window that currently has focus.  This is where the key
     *            event will normally go.
     * @param event The key event.
     * @param policyFlags The policy flags associated with the key.
     * @return Returns true if the policy consumed the event and it should
     * not be further dispatched.
File
WindowManagerPolicy.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
     * @return Returns true if the policy consumed the event and it should
     * not be further dispatched.
     */
<<<<<<< HEAD
    public boolean interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags);

    /**
     * Called from the input dispatcher thread when an application did not handle
     * a key that was dispatched to it.
     *
     * 

Allows you to define default global behavior for keys that were not handled * by applications. This method is called from the input thread, with no locks held. * * @param win The window that currently has focus. This is where the key * event will normally go. * @param event The key event. * @param policyFlags The policy flags associated with the key. * @return Returns an alternate key event to redispatch as a fallback, or null to give up. * The caller is responsible for recycling the key event. */ public KeyEvent dispatchUnhandledKey(WindowState win, KeyEvent event, int policyFlags); ======= public boolean interceptKeyBeforeDispatching(WindowState win, int action, int flags, int keyCode, int scanCode, int metaState, int repeatCount, int policyFlags); >>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753 /** * Called when layout of the windows is about to start.

Solution content
     * @return Returns true if the policy consumed the event and it should
     * not be further dispatched.
     */
    public boolean interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags);

    /**
     * Called from the input dispatcher thread when an application did not handle
     * a key that was dispatched to it.
     *
     * 

Allows you to define default global behavior for keys that were not handled * by applications. This method is called from the input thread, with no locks held. * * @param win The window that currently has focus. This is where the key * event will normally go. * @param event The key event. * @param policyFlags The policy flags associated with the key. * @return Returns an alternate key event to redispatch as a fallback, or null to give up. * The caller is responsible for recycling the key event. */ public KeyEvent dispatchUnhandledKey(WindowState win, KeyEvent event, int policyFlags); /** * Called when layout of the windows is about to start.

File
WindowManagerPolicy.java
Developer's decision
Version 1
Kind of conflict
Comment
Method interface
Chunk
Conflicting content
        return false;
    }

<<<<<<< HEAD
=======
    /** {@inheritDoc} */
    public void onTrigger(View v, int whichHandle) {
        if (whichHandle == SlidingTab.OnTriggerListener.LEFT_HANDLE) {
            mCallback.goToUnlockScreen();
        } else if (whichHandle == SlidingTab.OnTriggerListener.RIGHT_HANDLE) {
            // toggle silent mode
            mSilentMode = !mSilentMode;
            if (mSilentMode) {
                final boolean vibe = (Settings.System.getInt(
                    getContext().getContentResolver(),
                    Settings.System.VIBRATE_IN_SILENT, 1) == 1);

                mAudioManager.setRingerMode(vibe
                    ? AudioManager.RINGER_MODE_VIBRATE
                    : AudioManager.RINGER_MODE_SILENT);
            } else {
                mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
            }

            updateRightTabResources();

            String message = mSilentMode ?
                    getContext().getString(R.string.global_action_silent_mode_on_status) :
                    getContext().getString(R.string.global_action_silent_mode_off_status);

            final int toastIcon = mSilentMode
                ? R.drawable.ic_lock_ringer_off
                : R.drawable.ic_lock_ringer_on;

            final int toastColor = mSilentMode
                ? getContext().getResources().getColor(R.color.keyguard_text_color_soundoff)
                : getContext().getResources().getColor(R.color.keyguard_text_color_soundon);
            toastMessage(mScreenLocked, message, toastColor, toastIcon);
            mCallback.pokeWakelock();
        }
    }

    /** {@inheritDoc} */
    public void onGrabbedStateChange(View v, int grabbedState) {
        if (grabbedState == SlidingTab.OnTriggerListener.RIGHT_HANDLE) {
            mSilentMode = isSilentMode();
            mSelector.setRightHintText(mSilentMode ? R.string.lockscreen_sound_on_label
                    : R.string.lockscreen_sound_off_label);
        }
        // Don't poke the wake lock when returning to a state where the handle is
        // not grabbed since that can happen when the system (instead of the user)
        // cancels the grab.
        if (grabbedState != SlidingTab.OnTriggerListener.NO_HANDLE) {
            mCallback.pokeWakelock();
        }
    }

>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
    /**
     * Displays a message in a text view and then restores the previous text.
     * @param textView The text view.
Solution content
        return false;
    }

    /**
     * Displays a message in a text view and then restores the previous text.
     * @param textView The text view.
File
LockScreen.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
                mPowerKeyHandled = true;
    };
    private final Runnable mPowerLongPress = new Runnable() {
        public void run() {
            if (!mPowerKeyHandled) {
<<<<<<< HEAD
                // The context isn't read
                if (mLongPressOnPowerBehavior < 0) {
                    mLongPressOnPowerBehavior = mContext.getResources().getInteger(
                            com.android.internal.R.integer.config_longPressOnPowerBehavior);
                }
                switch (mLongPressOnPowerBehavior) {
                case LONG_PRESS_POWER_NOTHING:
                    break;
                case LONG_PRESS_POWER_GLOBAL_ACTIONS:
                    mPowerKeyHandled = true;
                    performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
                    sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                    showGlobalActionsDialog();
                    break;
                case LONG_PRESS_POWER_SHUT_OFF:
                    mPowerKeyHandled = true;
                    performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
                    sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                    ShutdownThread.shutdown(mContext, true);
                    break;
                }
=======
                performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
                sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                showGlobalActionsDialog();
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
            }
        }
Solution content
    private final Runnable mPowerLongPress = new Runnable() {
        public void run() {
            if (!mPowerKeyHandled) {
                // The context isn't read
                if (mLongPressOnPowerBehavior < 0) {
                    mLongPressOnPowerBehavior = mContext.getResources().getInteger(
                            com.android.internal.R.integer.config_longPressOnPowerBehavior);
                }
                switch (mLongPressOnPowerBehavior) {
                case LONG_PRESS_POWER_NOTHING:
                    break;
                case LONG_PRESS_POWER_GLOBAL_ACTIONS:
                    mPowerKeyHandled = true;
                    performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
                    sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                    showGlobalActionsDialog();
                    break;
                case LONG_PRESS_POWER_SHUT_OFF:
                    mPowerKeyHandled = true;
                    performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
                    sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                    ShutdownThread.shutdown(mContext, true);
                    break;
                }
            }
        }
    };
File
PhoneWindowManager.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
If statement
Method invocation
Switch statement
Chunk
Conflicting content
    /** {@inheritDoc} */
    @Override
<<<<<<< HEAD
    public boolean interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags) {
=======
    public boolean interceptKeyBeforeDispatching(WindowState win, int action, int flags,
            int keyCode, int scanCode, int metaState, int repeatCount, int policyFlags) {
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
        final boolean keyguardOn = keyguardOn();
        final int keyCode = event.getKeyCode();
        final int repeatCount = event.getRepeatCount();
Solution content
    /** {@inheritDoc} */

    @Override
    public boolean interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags) {
        final boolean keyguardOn = keyguardOn();
        final int keyCode = event.getKeyCode();
        final int repeatCount = event.getRepeatCount();
File
PhoneWindowManager.java
Developer's decision
Version 1
Kind of conflict
Method signature
Chunk
Conflicting content
            // If we have released the home key, and didn't do anything else
            // while it was pressed, then it is time to go home!
<<<<<<< HEAD
            if (mHomePressed && !down) {
                mHomePressed = false;
                if (!canceled) {
                    // If an incoming call is ringing, HOME is totally disabled.
                    // (The user is already on the InCallScreen at this point,
                    // and his ONLY options are to answer or reject the call.)
                    boolean incomingRinging = false;
                    try {
                        ITelephony telephonyService = getTelephonyService();
                        if (telephonyService != null) {
                            incomingRinging = telephonyService.isRinging();
=======
            if (keyCode == KeyEvent.KEYCODE_HOME) {
                if (!down) {
                    mHomePressed = false;
                    
                    if (!canceled) {
                        // If an incoming call is ringing, HOME is totally disabled.
                        // (The user is already on the InCallScreen at this point,
                        // and his ONLY options are to answer or reject the call.)
                        boolean incomingRinging = false;
                        try {
                            ITelephony telephonyService = getTelephonyService();
                            if (telephonyService != null) {
                                incomingRinging = telephonyService.isRinging();
                            }
                        } catch (RemoteException ex) {
                            Log.w(TAG, "RemoteException from getPhoneInterface()", ex);
                        }
        
                        if (incomingRinging) {
                            Log.i(TAG, "Ignoring HOME; there's a ringing incoming call.");
                        } else {
                            launchHomeFromHotKey();
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
                        }
                    } catch (RemoteException ex) {
                        Log.w(TAG, "RemoteException from getPhoneInterface()", ex);
Solution content
            // If we have released the home key, and didn't do anything else
            // while it was pressed, then it is time to go home!
            if (mHomePressed && !down) {
                mHomePressed = false;
                if (!canceled) {
                    // If an incoming call is ringing, HOME is totally disabled.
                    // (The user is already on the InCallScreen at this point,
                    // and his ONLY options are to answer or reject the call.)
                    boolean incomingRinging = false;
                    try {
                        ITelephony telephonyService = getTelephonyService();
                        if (telephonyService != null) {
                            incomingRinging = telephonyService.isRinging();
                        }
                    } catch (RemoteException ex) {
                        Log.w(TAG, "RemoteException from getPhoneInterface()", ex);
File
PhoneWindowManager.java
Developer's decision
Version 1
Kind of conflict
Attribute
Comment
If statement
Method invocation
Try statement
Variable
Chunk
Conflicting content
            mBroadcastWakeLock.release();
        }
    }
<<<<<<< HEAD

    /** {@inheritDoc} */
    @Override
    public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn) {
        final boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
        final boolean canceled = event.isCanceled();
        final int keyCode = event.getKeyCode();
=======
 
    /** {@inheritDoc} */
    @Override
    public int interceptKeyBeforeQueueing(long whenNanos, int action, int flags,
            int keyCode, int scanCode, int policyFlags, boolean isScreenOn) {
        final boolean down = action == KeyEvent.ACTION_DOWN;
        final boolean canceled = (flags & KeyEvent.FLAG_CANCELED) != 0;
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753

        final boolean isInjected = (policyFlags & WindowManagerPolicy.FLAG_INJECTED) != 0;
Solution content
            mBroadcastWakeLock.release();
        }
    }

    /** {@inheritDoc} */
    @Override
    public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn) {
        final boolean down = event.getAction() == KeyEvent.ACTION_DOWN;
        final boolean canceled = event.isCanceled();
        final int keyCode = event.getKeyCode();

        final boolean isInjected = (policyFlags & WindowManagerPolicy.FLAG_INJECTED) != 0;
File
PhoneWindowManager.java
Developer's decision
Version 1
Kind of conflict
Annotation
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
        }
        if (down && (policyFlags & WindowManagerPolicy.FLAG_VIRTUAL) != 0) {
            performHapticFeedbackLw(null, HapticFeedbackConstants.VIRTUAL_KEY, false);
<<<<<<< HEAD

        // Basic policy based on screen state and keyguard.
        // FIXME: This policy isn't quite correct.  We shouldn't care whether the screen
        //        is on or off, really.  We should care about whether the device is in an
        //        interactive state or is in suspend pretending to be "off".
        //        The primary screen might be turned off due to proximity sensor or
        //        because we are presenting media on an auxiliary screen or remotely controlling
        //        the device some other way (which is why we have an exemption here for injected
        //        events).
        int result;
        if (isScreenOn || isInjected) {
            // When the screen is on or if the key is injected pass the key to the application.
            result = ACTION_PASS_TO_USER;
        } else {
            // When the screen is off and the key is not injected, determine whether
            // to wake the device but don't pass the key to the application.
            result = 0;

            final boolean isWakeKey = (policyFlags
                    & (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
            if (down && isWakeKey) {
                if (keyguardActive) {
                    // If the keyguard is showing, let it decide what to do with the wake key.
                    mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);
                } else {
                    // Otherwise, wake the device ourselves.
                    result |= ACTION_POKE_USER_ACTIVITY;
                }
            }
        }

        // Handle special keys.
        switch (keyCode) {
            case KeyEvent.KEYCODE_VOLUME_DOWN:
            case KeyEvent.KEYCODE_VOLUME_UP:
            case KeyEvent.KEYCODE_VOLUME_MUTE: {
=======

        // Basic policy based on screen state and keyguard.
        // FIXME: This policy isn't quite correct.  We shouldn't care whether the screen
        //        is on or off, really.  We should care about whether the device is in an
        //        interactive state or is in suspend pretending to be "off".
        //        The primary screen might be turned off due to proximity sensor or
        //        because we are presenting media on an auxiliary screen or remotely controlling
        //        the device some other way (which is why we have an exemption here for injected
        //        events).
        int result;
        if (isScreenOn || isInjected) {
            // When the screen is on or if the key is injected pass the key to the application.
            result = ACTION_PASS_TO_USER;
        } else {
            // When the screen is off and the key is not injected, determine whether
            // to wake the device but don't pass the key to the application.
            result = 0;

            final boolean isWakeKey = (policyFlags
                    & (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
            if (down && isWakeKey) {
                if (keyguardActive) {
                    // If the keyguard is showing, let it decide what to do with the wake key.
                    mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);
                } else {
                    // Otherwise, wake the device ourselves.
                    result |= ACTION_POKE_USER_ACTIVITY;
                }
            }
        }

        // Handle special keys.
        switch (keyCode) {
            case KeyEvent.KEYCODE_VOLUME_DOWN:
            case KeyEvent.KEYCODE_VOLUME_UP: {
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
                if (down) {
                    ITelephony telephonyService = getTelephonyService();
                    if (telephonyService != null) {
Solution content
        if (down && (policyFlags & WindowManagerPolicy.FLAG_VIRTUAL) != 0) {
            performHapticFeedbackLw(null, HapticFeedbackConstants.VIRTUAL_KEY, false);
        }

        // Basic policy based on screen state and keyguard.
        // FIXME: This policy isn't quite correct.  We shouldn't care whether the screen
        //        is on or off, really.  We should care about whether the device is in an
        //        interactive state or is in suspend pretending to be "off".
        //        The primary screen might be turned off due to proximity sensor or
        //        because we are presenting media on an auxiliary screen or remotely controlling
        //        the device some other way (which is why we have an exemption here for injected
        //        events).
        int result;
        if (isScreenOn || isInjected) {
            // When the screen is on or if the key is injected pass the key to the application.
            result = ACTION_PASS_TO_USER;
        } else {
            // When the screen is off and the key is not injected, determine whether
            // to wake the device but don't pass the key to the application.
            result = 0;

            final boolean isWakeKey = (policyFlags
                    & (WindowManagerPolicy.FLAG_WAKE | WindowManagerPolicy.FLAG_WAKE_DROPPED)) != 0;
            if (down && isWakeKey) {
                if (keyguardActive) {
                    // If the keyguard is showing, let it decide what to do with the wake key.
                    mKeyguardMediator.onWakeKeyWhenKeyguardShowingTq(keyCode);
                } else {
                    // Otherwise, wake the device ourselves.
                    result |= ACTION_POKE_USER_ACTIVITY;
                }
            }
        }

        // Handle special keys.
        switch (keyCode) {
            case KeyEvent.KEYCODE_VOLUME_DOWN:
            case KeyEvent.KEYCODE_VOLUME_UP:
            case KeyEvent.KEYCODE_VOLUME_MUTE: {
                if (down) {
                    ITelephony telephonyService = getTelephonyService();
                    if (telephonyService != null) {
File
PhoneWindowManager.java
Developer's decision
Version 1
Kind of conflict
Case statement
Comment
If statement
Switch statement
Variable
Chunk
Conflicting content
                break;
            }

<<<<<<< HEAD
            case KeyEvent.KEYCODE_MEDIA_PLAY:
            case KeyEvent.KEYCODE_MEDIA_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
                if (down) {
                    ITelephony telephonyService = getTelephonyService();
                    if (telephonyService != null) {
                        try {
                            if (!telephonyService.isIdle()) {
                                // Suppress PLAY/PAUSE toggle when phone is ringing or in-call
                                // to avoid music playback.
                                break;
                            }
                        } catch (RemoteException ex) {
                            Log.w(TAG, "ITelephony threw RemoteException", ex);
                        }
                    }
                }
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MUTE:
            case KeyEvent.KEYCODE_MEDIA_STOP:
            case KeyEvent.KEYCODE_MEDIA_NEXT:
            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
            case KeyEvent.KEYCODE_MEDIA_REWIND:
            case KeyEvent.KEYCODE_MEDIA_RECORD:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: {
                if ((result & ACTION_PASS_TO_USER) == 0) {
                    // Only do this if we would otherwise not pass it to the user. In that
                    // case, the PhoneWindow class will do the same thing, except it will
                    // only do it if the showing app doesn't process the key on its own.
                    mBroadcastWakeLock.acquire();
                    mHandler.post(new PassHeadsetKey(new KeyEvent(event)));
                }
=======
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_STOP:
            case KeyEvent.KEYCODE_MEDIA_NEXT:
            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
            case KeyEvent.KEYCODE_MEDIA_REWIND:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: {
                if ((result & ACTION_PASS_TO_USER) == 0) {
                    // Only do this if we would otherwise not pass it to the user. In that
                    // case, the PhoneWindow class will do the same thing, except it will
                    // only do it if the showing app doesn't process the key on its own.
                    long when = whenNanos / 1000000;
                    KeyEvent keyEvent = new KeyEvent(when, when, action, keyCode, 0, 0,
                            0, scanCode, flags, InputDevice.SOURCE_KEYBOARD);
                    mBroadcastWakeLock.acquire();
                    mHandler.post(new PassHeadsetKey(keyEvent));
                }
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
                break;
            }
Solution content
                break;
            }

            case KeyEvent.KEYCODE_MEDIA_PLAY:
            case KeyEvent.KEYCODE_MEDIA_PAUSE:
            case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
                if (down) {
                    ITelephony telephonyService = getTelephonyService();
                    if (telephonyService != null) {
                        try {
                            if (!telephonyService.isIdle()) {
                                // Suppress PLAY/PAUSE toggle when phone is ringing or in-call
                                // to avoid music playback.
                                break;
                            }
                        } catch (RemoteException ex) {
                            Log.w(TAG, "ITelephony threw RemoteException", ex);
                        }
                    }
                }
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MUTE:
            case KeyEvent.KEYCODE_MEDIA_STOP:
            case KeyEvent.KEYCODE_MEDIA_NEXT:
            case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
            case KeyEvent.KEYCODE_MEDIA_REWIND:
            case KeyEvent.KEYCODE_MEDIA_RECORD:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: {
                if ((result & ACTION_PASS_TO_USER) == 0) {
                    // Only do this if we would otherwise not pass it to the user. In that
                    // case, the PhoneWindow class will do the same thing, except it will
                    // only do it if the showing app doesn't process the key on its own.
                    mBroadcastWakeLock.acquire();
                    mHandler.post(new PassHeadsetKey(new KeyEvent(event)));
                }
                break;
            }
File
PhoneWindowManager.java
Developer's decision
Version 1
Kind of conflict
Case statement
If statement
Chunk
Conflicting content
        }
        
        @SuppressWarnings("unused")
<<<<<<< HEAD
        public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn) {
            return mWindowManagerService.mInputMonitor.interceptKeyBeforeQueueing(
                    event, policyFlags, isScreenOn);
        }
        
        @SuppressWarnings("unused")
        public boolean interceptKeyBeforeDispatching(InputChannel focus,
                KeyEvent event, int policyFlags) {
            return mWindowManagerService.mInputMonitor.interceptKeyBeforeDispatching(
                    focus, event, policyFlags);
        }
        
        @SuppressWarnings("unused")
        public KeyEvent dispatchUnhandledKey(InputChannel focus,
                KeyEvent event, int policyFlags) {
            return mWindowManagerService.mInputMonitor.dispatchUnhandledKey(
                    focus, event, policyFlags);
=======
        public int interceptKeyBeforeQueueing(long whenNanos, int action, int flags,
                int keyCode, int scanCode, int policyFlags, boolean isScreenOn) {
            return mWindowManagerService.mInputMonitor.interceptKeyBeforeQueueing(
                    whenNanos, action, flags, keyCode, scanCode, policyFlags, isScreenOn);
        }
        
        @SuppressWarnings("unused")
        public boolean interceptKeyBeforeDispatching(InputChannel focus, int action,
                int flags, int keyCode, int scanCode, int metaState, int repeatCount,
                int policyFlags) {
            return mWindowManagerService.mInputMonitor.interceptKeyBeforeDispatching(focus,
                    action, flags, keyCode, scanCode, metaState, repeatCount, policyFlags);
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
        }
        
        @SuppressWarnings("unused")
Solution content
        }
        }
        
        @SuppressWarnings("unused")
        public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags, boolean isScreenOn) {
            return mWindowManagerService.mInputMonitor.interceptKeyBeforeQueueing(
                    event, policyFlags, isScreenOn);
        
        @SuppressWarnings("unused")
        public boolean interceptKeyBeforeDispatching(InputChannel focus,
                KeyEvent event, int policyFlags) {
            return mWindowManagerService.mInputMonitor.interceptKeyBeforeDispatching(
                    focus, event, policyFlags);
        }
        
        @SuppressWarnings("unused")
        public KeyEvent dispatchUnhandledKey(InputChannel focus,
                KeyEvent event, int policyFlags) {
            return mWindowManagerService.mInputMonitor.dispatchUnhandledKey(
                    focus, event, policyFlags);
        }
        
        @SuppressWarnings("unused")
File
InputManager.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Method invocation
Method signature
Return statement
Chunk
Conflicting content
        
        /* Provides an opportunity for the window manager policy to intercept early key
         * processing as soon as the key has been read from the device. */
<<<<<<< HEAD
        public int interceptKeyBeforeQueueing(
                KeyEvent event, int policyFlags, boolean isScreenOn) {
            return mPolicy.interceptKeyBeforeQueueing(event, policyFlags, isScreenOn);
=======
        public int interceptKeyBeforeQueueing(long whenNanos, int action, int flags,
                int keyCode, int scanCode, int policyFlags, boolean isScreenOn) {
            return mPolicy.interceptKeyBeforeQueueing(whenNanos, action, flags,
                    keyCode, scanCode, policyFlags, isScreenOn);
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
        }
        
        /* Provides an opportunity for the window manager policy to process a key before
Solution content
        
        /* Provides an opportunity for the window manager policy to intercept early key
         * processing as soon as the key has been read from the device. */
        public int interceptKeyBeforeQueueing(
                KeyEvent event, int policyFlags, boolean isScreenOn) {
            return mPolicy.interceptKeyBeforeQueueing(event, policyFlags, isScreenOn);
        }
        
        /* Provides an opportunity for the window manager policy to process a key before
File
WindowManagerService.java
Developer's decision
Version 1
Kind of conflict
Method invocation
Method signature
Return statement
Chunk
Conflicting content
        
        /* Provides an opportunity for the window manager policy to process a key before
         * ordinary dispatch. */
<<<<<<< HEAD
        public boolean interceptKeyBeforeDispatching(
                InputChannel focus, KeyEvent event, int policyFlags) {
            WindowState windowState = getWindowStateForInputChannel(focus);
            return mPolicy.interceptKeyBeforeDispatching(windowState, event, policyFlags);
        }
        
        /* Provides an opportunity for the window manager policy to process a key that
         * the application did not handle. */
        public KeyEvent dispatchUnhandledKey(
                InputChannel focus, KeyEvent event, int policyFlags) {
            WindowState windowState = getWindowStateForInputChannel(focus);
            return mPolicy.dispatchUnhandledKey(windowState, event, policyFlags);
=======
        public boolean interceptKeyBeforeDispatching(InputChannel focus,
                int action, int flags, int keyCode, int scanCode, int metaState, int repeatCount,
                int policyFlags) {
            WindowState windowState = getWindowStateForInputChannel(focus);
            return mPolicy.interceptKeyBeforeDispatching(windowState, action, flags,
                    keyCode, scanCode, metaState, repeatCount, policyFlags);
>>>>>>> fa93584a4fab6ca8d9348658dc30cedf76891753
        }
        
        /* Called when the current input focus changes.
Solution content
        
        /* Provides an opportunity for the window manager policy to process a key before
         * ordinary dispatch. */
        public boolean interceptKeyBeforeDispatching(
                InputChannel focus, KeyEvent event, int policyFlags) {
            WindowState windowState = getWindowStateForInputChannel(focus);
            return mPolicy.interceptKeyBeforeDispatching(windowState, event, policyFlags);
        }
        
        /* Provides an opportunity for the window manager policy to process a key that
         * the application did not handle. */
        public KeyEvent dispatchUnhandledKey(
                InputChannel focus, KeyEvent event, int policyFlags) {
            WindowState windowState = getWindowStateForInputChannel(focus);
            return mPolicy.dispatchUnhandledKey(windowState, event, policyFlags);
        }
        
        /* Called when the current input focus changes.
File
WindowManagerService.java
Developer's decision
Version 1
Kind of conflict
Comment
Method declaration
Method invocation
Method signature
Return statement
Variable