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

Commit bab2b424 authored by Michael Wright's avatar Michael Wright
Browse files

resolve merge conflicts of 57a5cba6 to cw-e-dev.

Change-Id: Ib43f0cf0b285c9799239658859af735279f87fff
parents 6320767f 57a5cba6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ interface IInputManager {
    // Registers an input devices changed listener.
    void registerInputDevicesChangedListener(IInputDevicesChangedListener listener);

    // Queries whether the device is currently in tablet mode
    int isInTabletMode();
    // Registers a tablet mode change listener
    void registerTabletModeChangedListener(ITabletModeChangedListener listener);

+45 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.hardware.input;
import com.android.internal.os.SomeArgs;
import com.android.internal.util.ArrayUtils;

import android.annotation.IntDef;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.content.Context;
@@ -39,6 +40,8 @@ import android.util.SparseArray;
import android.view.InputDevice;
import android.view.InputEvent;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;

@@ -179,6 +182,31 @@ public final class InputManager {
     */
    public static final int INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH = 2;  // see InputDispatcher.h

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef({SWITCH_STATE_UNKNOWN, SWITCH_STATE_OFF, SWITCH_STATE_ON})
    public @interface SwitchState {}

    /**
     * Switch State: Unknown.
     *
     * The system has yet to report a valid value for the switch.
     * @hide
     */
    public static final int SWITCH_STATE_UNKNOWN = -1;

    /**
     * Switch State: Off.
     * @hide
     */
    public static final int SWITCH_STATE_OFF = 0;

    /**
     * Switch State: On.
     * @hide
     */
    public static final int SWITCH_STATE_ON = 1;

    private InputManager(IInputManager im) {
        mIm = im;
    }
@@ -338,6 +366,23 @@ public final class InputManager {
        return -1;
    }

    /**
     * Queries whether the device is in tablet mode.
     *
     * @return The tablet switch state which is one of {@link #SWITCH_STATE_UNKNOWN},
     * {@link #SWITCH_STATE_OFF} or {@link #SWITCH_STATE_ON}.
     * @hide
     */
    @SwitchState
    public int isInTabletMode() {
        try {
            return mIm.isInTabletMode();
        } catch (RemoteException ex) {
            Log.w(TAG, "Could not get tablet mode state", ex);
            return SWITCH_STATE_UNKNOWN;
        }
    }

    /**
     * Register a tablet mode changed listener.
     *
+3 −2
Original line number Diff line number Diff line
@@ -2067,10 +2067,11 @@
    <permission android:name="android.permission.SET_KEYBOARD_LAYOUT"
        android:protectionLevel="signature" />

    <!-- Allows an application to monitor changes in tablet mode.
    <!-- Allows an application to query tablet mode state and monitor changes
         in it.
         <p>Not for use by third-party applications.
         @hide -->
    <permission android:name="android.permission.TABLET_MODE_LISTENER"
    <permission android:name="android.permission.TABLET_MODE"
        android:protectionLevel="signature" />

    <!-- Allows an application to request installing packages. Apps
+4 −0
Original line number Diff line number Diff line
@@ -2351,4 +2351,8 @@
    <!-- Name of the component to handle network policy notifications. If present,
         disables NetworkPolicyManagerService's presentation of data-usage notifications. -->
    <string translatable="false" name="config_networkPolicyNotificationComponent"></string>

    <!-- The BT name of the keyboard packaged with the device. If this is defined, SystemUI will
         automatically try to pair with it when the device exits tablet mode. -->
    <string translatable="false" name="config_packagedKeyboardName"></string>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -2339,4 +2339,5 @@
  <java-symbol type="drawable" name="platlogo_m" />

  <java-symbol type="string" name="config_iccHotswapPromptForRestartDialogComponent" />
  <java-symbol type="string" name="config_packagedKeyboardName" />
</resources>
Loading