diff options
author | 2018-06-08 15:11:57 -0700 | |
---|---|---|
committer | 2018-06-08 15:11:57 -0700 | |
commit | f11e2bd016d886a333345dea853ebda23a408d5c (patch) | |
tree | 905bd4d25d6ab2b046620ff459777d8dcfa5d7de /include | |
parent | aabd6b7fa343654cd85b3b2da392e424d037d15a (diff) | |
parent | 5c947cdf72270fd1f766b2248d526ebc8c7227f6 (diff) |
Merge pi-dev-plus-aosp-without-vendor into stage-aosp-master
Bug: 79597307
Change-Id: I6d6bee71b9424eb478780bbfc06b830eb8ded342
Diffstat (limited to 'include')
-rw-r--r-- | include/android/hardware_buffer_jni.h | 8 | ||||
-rw-r--r-- | include/android/keycodes.h | 4 | ||||
-rw-r--r-- | include/android/sensor.h | 4 | ||||
-rw-r--r-- | include/android/surface_texture.h | 162 | ||||
-rw-r--r-- | include/android/surface_texture_jni.h | 53 | ||||
-rw-r--r-- | include/audiomanager/IAudioManager.h | 88 | ||||
-rw-r--r-- | include/audiomanager/IPlayer.h | 69 | ||||
-rw-r--r-- | include/input/InputEventLabels.h | 1 | ||||
-rw-r--r-- | include/input/InputTransport.h | 9 | ||||
-rw-r--r-- | include/input/KeyCharacterMap.h | 3 | ||||
-rw-r--r-- | include/input/VelocityTracker.h | 34 | ||||
l--------- | include/layerproto | 1 |
12 files changed, 272 insertions, 164 deletions
diff --git a/include/android/hardware_buffer_jni.h b/include/android/hardware_buffer_jni.h index 60208701b6..7c4be24dbd 100644 --- a/include/android/hardware_buffer_jni.h +++ b/include/android/hardware_buffer_jni.h @@ -31,9 +31,11 @@ __BEGIN_DECLS /** * Return the AHardwareBuffer associated with a Java HardwareBuffer object, - * for interacting with it through native code. This acquires a reference - * on the AHardwareBuffer that is returned; be sure to use - * AHardwareBuffer_release() when done with it so that it doesn't leak. + * for interacting with it through native code. This method does not acquire any + * additional reference to the AHardwareBuffer that is returned. To keep the + * AHardwareBuffer live after the Java HardwareBuffer object got garbage + * collected, be sure to use AHardwareBuffer_acquire() to acquire an additional + * reference. */ AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer(JNIEnv* env, jobject hardwareBufferObj); diff --git a/include/android/keycodes.h b/include/android/keycodes.h index 2164d6163e..59d67f35f2 100644 --- a/include/android/keycodes.h +++ b/include/android/keycodes.h @@ -767,7 +767,9 @@ enum { /** fingerprint navigation key, right. */ AKEYCODE_SYSTEM_NAVIGATION_RIGHT = 283, /** all apps */ - AKEYCODE_ALL_APPS = 284 + AKEYCODE_ALL_APPS = 284, + /** refresh key */ + AKEYCODE_REFRESH = 285 // NOTE: If you add a new keycode here you must also add it to several other files. // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. diff --git a/include/android/sensor.h b/include/android/sensor.h index 029db0a2fe..191777cee5 100644 --- a/include/android/sensor.h +++ b/include/android/sensor.h @@ -288,7 +288,7 @@ enum { * A sensor event. */ -/* NOTE: Must match hardware/sensors.h */ +/* NOTE: changes to these structs have to be backward compatible */ typedef struct ASensorVector { union { float v[3]; @@ -350,7 +350,7 @@ typedef struct { }; } AAdditionalInfoEvent; -/* NOTE: Must match hardware/sensors.h */ +/* NOTE: changes to this struct has to be backward compatible */ typedef struct ASensorEvent { int32_t version; /* sizeof(struct ASensorEvent) */ int32_t sensor; diff --git a/include/android/surface_texture.h b/include/android/surface_texture.h new file mode 100644 index 0000000000..56b3342166 --- /dev/null +++ b/include/android/surface_texture.h @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup SurfaceTexture + * @{ + */ + +/** + * @file surface_texture.h + */ + +#ifndef ANDROID_NATIVE_SURFACE_TEXTURE_H +#define ANDROID_NATIVE_SURFACE_TEXTURE_H + +/****************************************************************** + * + * IMPORTANT NOTICE: + * + * This file is part of Android's set of stable system headers + * exposed by the Android NDK (Native Development Kit). + * + * Third-party source AND binary code relies on the definitions + * here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES. + * + * - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES) + * - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS + * - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY + * - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES + */ + +#include <stdint.h> + +#include <android/native_window.h> + +__BEGIN_DECLS + +struct ASurfaceTexture; + +/** + * {@link ASurfaceTexture} is an opaque type to manage SurfaceTexture from native code + * + * {@link ASurfaceTexture} can be obtained from an android.graphics.SurfaceTexture object using + * ASurfaceTexture_fromSurfaceTexture(). + */ +typedef struct ASurfaceTexture ASurfaceTexture; + +/** + * Release the reference to the native ASurfaceTexture acquired with + * ASurfaceTexture_fromSurfaceTexture(). + * Failing to do so will result in leaked memory and graphic resources. + * \param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture() + */ +void ASurfaceTexture_release(ASurfaceTexture* st); + +/** + * Returns a reference to an ANativeWindow (i.e. the Producer) for this SurfaceTexture. + * This is equivalent to Java's: Surface sur = new Surface(surfaceTexture); + * + * \param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture() + * @return A reference to an ANativeWindow. This reference MUST BE released when no longer needed + * using ANativeWindow_release(). Failing to do so will result in leaked resources. nullptr is + * returned if \st is null or if it's not an instance of android.graphics.SurfaceTexture + */ +ANativeWindow* ASurfaceTexture_acquireANativeWindow(ASurfaceTexture* st); + +/** + * Attach the SurfaceTexture to the OpenGL ES context that is current on the calling thread. A + * new OpenGL ES texture object is created and populated with the SurfaceTexture image frame + * that was current at the time of the last call to {@link #detachFromGLContext}. This new + * texture is bound to the GL_TEXTURE_EXTERNAL_OES texture target. + * + * This can be used to access the SurfaceTexture image contents from multiple OpenGL ES + * contexts. Note, however, that the image contents are only accessible from one OpenGL ES + * context at a time. + * + * \param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture() + * \param texName The name of the OpenGL ES texture that will be created. This texture name + * must be unusued in the OpenGL ES context that is current on the calling thread. + * \return 0 on success, negative posix error code otherwise (see <errno.h>) + */ +int ASurfaceTexture_attachToGLContext(ASurfaceTexture* st, uint32_t texName); + +/** + * Detach the SurfaceTexture from the OpenGL ES context that owns the OpenGL ES texture object. + * This call must be made with the OpenGL ES context current on the calling thread. The OpenGL + * ES texture object will be deleted as a result of this call. After calling this method all + * calls to {@link #updateTexImage} will fail until a successful call to {@link #attachToGLContext} + * is made. + * + * This can be used to access the SurfaceTexture image contents from multiple OpenGL ES + * contexts. Note, however, that the image contents are only accessible from one OpenGL ES + * context at a time. + * + * \param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture() + * \return 0 on success, negative posix error code otherwise (see <errno.h>) + */ +int ASurfaceTexture_detachFromGLContext(ASurfaceTexture* st); + +/** + * Update the texture image to the most recent frame from the image stream. This may only be + * called while the OpenGL ES context that owns the texture is current on the calling thread. + * It will implicitly bind its texture to the GL_TEXTURE_EXTERNAL_OES texture target. + * + * \param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture() + * \return 0 on success, negative posix error code otherwise (see <errno.h>) + */ +int ASurfaceTexture_updateTexImage(ASurfaceTexture* st); + +/** + * Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by + * the most recent call to updateTexImage. + * + * This transform matrix maps 2D homogeneous texture coordinates of the form (s, t, 0, 1) with s + * and t in the inclusive range [0, 1] to the texture coordinate that should be used to sample + * that location from the texture. Sampling the texture outside of the range of this transform + * is undefined. + * + * The matrix is stored in column-major order so that it may be passed directly to OpenGL ES via + * the glLoadMatrixf or glUniformMatrix4fv functions. + * + * \param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture() + * \param mtx the array into which the 4x4 matrix will be stored. The array must have exactly + * 16 elements. + */ +void ASurfaceTexture_getTransformMatrix(ASurfaceTexture* st, float mtx[16]); + +/** + * Retrieve the timestamp associated with the texture image set by the most recent call to + * updateTexImage. + * + * This timestamp is in nanoseconds, and is normally monotonically increasing. The timestamp + * should be unaffected by time-of-day adjustments, and for a camera should be strictly + * monotonic but for a MediaPlayer may be reset when the position is set. The + * specific meaning and zero point of the timestamp depends on the source providing images to + * the SurfaceTexture. Unless otherwise specified by the image source, timestamps cannot + * generally be compared across SurfaceTexture instances, or across multiple program + * invocations. It is mostly useful for determining time offsets between subsequent frames. + * + * For EGL/Vulkan producers, this timestamp is the desired present time set with the + * EGL_ANDROID_presentation_time or VK_GOOGLE_display_timing extensions + * + * \param st A ASurfaceTexture reference acquired with ASurfaceTexture_fromSurfaceTexture() + */ +int64_t ASurfaceTexture_getTimestamp(ASurfaceTexture* st); + +__END_DECLS + +#endif /* ANDROID_NATIVE_SURFACE_TEXTURE_H */ diff --git a/include/android/surface_texture_jni.h b/include/android/surface_texture_jni.h new file mode 100644 index 0000000000..b0e1edd590 --- /dev/null +++ b/include/android/surface_texture_jni.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup SurfaceTexture + * @{ + */ + +/** + * @file surface_texture_jni.h + */ + +#ifndef ANDROID_NATIVE_SURFACE_TEXTURE_JNI_H +#define ANDROID_NATIVE_SURFACE_TEXTURE_JNI_H + +#include <android/surface_texture.h> + +#include <jni.h> + +__BEGIN_DECLS + +/** + * Get a reference to the native ASurfaceTexture from the corresponding java object. + * + * The caller must keep a reference to the Java SurfaceTexture during the lifetime of the returned + * ASurfaceTexture. Failing to do so could result in the ASurfaceTexture to stop functioning + * properly once the Java object gets finalized. + * However, this will not result in program termination. + * + * \param env JNI environment + * \param surfacetexture Instance of Java SurfaceTexture object + * \return native ASurfaceTexture reference or nullptr if the java object is not a SurfaceTexture. + * The returned reference MUST BE released when it's no longer needed using + * ASurfaceTexture_release(). + */ +ASurfaceTexture* ASurfaceTexture_fromSurfaceTexture(JNIEnv* env, jobject surfacetexture); + +__END_DECLS + +#endif /* ANDROID_NATIVE_SURFACE_TEXTURE_JNI_H */ diff --git a/include/audiomanager/IAudioManager.h b/include/audiomanager/IAudioManager.h index 067dc5cf22..d279bbd045 100644 --- a/include/audiomanager/IAudioManager.h +++ b/include/audiomanager/IAudioManager.h @@ -32,90 +32,10 @@ public: // These transaction IDs must be kept in sync with the method order from // IAudioService.aidl. enum { - // transaction IDs for the unsupported methods are commented out - /* - ADJUSTSUGGESTEDSTREAMVOLUME = IBinder::FIRST_CALL_TRANSACTION, - ADJUSTSTREAMVOLUME = IBinder::FIRST_CALL_TRANSACTION + 1, - SETSTREAMVOLUME = IBinder::FIRST_CALL_TRANSACTION + 2, - ISSTREAMMUTE = IBinder::FIRST_CALL_TRANSACTION + 3, - FORCEREMOTESUBMIXFULLVOLUME = IBinder::FIRST_CALL_TRANSACTION + 4, - ISMASTERMUTE = IBinder::FIRST_CALL_TRANSACTION + 5, - SETMASTERMUTE = IBinder::FIRST_CALL_TRANSACTION + 6, - GETSTREAMVOLUME = IBinder::FIRST_CALL_TRANSACTION + 7, - GETSTREAMMINVOLUME = IBinder::FIRST_CALL_TRANSACTION + 8, - GETSTREAMMAXVOLUME = IBinder::FIRST_CALL_TRANSACTION + 9, - GETLASTAUDIBLESTREAMVOLUME = IBinder::FIRST_CALL_TRANSACTION + 10, - SETMICROPHONEMUTE = IBinder::FIRST_CALL_TRANSACTION + 11, - SETRINGERMODEEXTERNAL = IBinder::FIRST_CALL_TRANSACTION + 12, - SETRINGERMODEINTERNAL = IBinder::FIRST_CALL_TRANSACTION + 13, - GETRINGERMODEEXTERNAL = IBinder::FIRST_CALL_TRANSACTION + 14, - GETRINGERMODEINTERNAL = IBinder::FIRST_CALL_TRANSACTION + 15, - ISVALIDRINGERMODE = IBinder::FIRST_CALL_TRANSACTION + 16, - SETVIBRATESETTING = IBinder::FIRST_CALL_TRANSACTION + 17, - GETVIBRATESETTING = IBinder::FIRST_CALL_TRANSACTION + 18, - SHOULDVIBRATE = IBinder::FIRST_CALL_TRANSACTION + 19, - SETMODE = IBinder::FIRST_CALL_TRANSACTION + 20, - GETMODE = IBinder::FIRST_CALL_TRANSACTION + 21, - PLAYSOUNDEFFECT = IBinder::FIRST_CALL_TRANSACTION + 22, - PLAYSOUNDEFFECTVOLUME = IBinder::FIRST_CALL_TRANSACTION + 23, - LOADSOUNDEFFECTS = IBinder::FIRST_CALL_TRANSACTION + 24, - UNLOADSOUNDEFFECTS = IBinder::FIRST_CALL_TRANSACTION + 25, - RELOADAUDIOSETTINGS = IBinder::FIRST_CALL_TRANSACTION + 26, - AVRCPSUPPORTSABSOLUTEVOLUME = IBinder::FIRST_CALL_TRANSACTION + 27, - SETSPEAKERPHONEON = IBinder::FIRST_CALL_TRANSACTION + 28, - ISSPEAKERPHONEON = IBinder::FIRST_CALL_TRANSACTION + 29, - SETBLUETOOTHSCOON = IBinder::FIRST_CALL_TRANSACTION + 30, - ISBLUETOOTHSCOON = IBinder::FIRST_CALL_TRANSACTION + 31, - SETBLUETOOTHA2DPON = IBinder::FIRST_CALL_TRANSACTION + 32, - ISBLUETOOTHA2DPON = IBinder::FIRST_CALL_TRANSACTION + 33, - REQUESTAUDIOFOCUS = IBinder::FIRST_CALL_TRANSACTION + 34, - ABANDONAUDIOFOCUS = IBinder::FIRST_CALL_TRANSACTION + 35, - UNREGISTERAUDIOFOCUSCLIENT = IBinder::FIRST_CALL_TRANSACTION + 36, - GETCURRENTAUDIOFOCUS = IBinder::FIRST_CALL_TRANSACTION + 37, - STARTBLUETOOTHSCO = IBinder::FIRST_CALL_TRANSACTION + 38, - STARTBLUETOOTHSCOVIRTUALCALL = IBinder::FIRST_CALL_TRANSACTION + 39, - STOPBLUETOOTHSCO = IBinder::FIRST_CALL_TRANSACTION + 40, - FORCEVOLUMECONTROLSTREAM = IBinder::FIRST_CALL_TRANSACTION + 41, - SETRINGTONEPLAYER = IBinder::FIRST_CALL_TRANSACTION + 42, - GETRINGTONEPLAYER = IBinder::FIRST_CALL_TRANSACTION + 43, - GETUISOUNDSSTREAMTYPE = IBinder::FIRST_CALL_TRANSACTION + 44, - SETWIREDDEVICECONNECTIONSTATE = IBinder::FIRST_CALL_TRANSACTION + 45, - SETBLUETOOTHA2DPDEVICECONNECTIONSTATE = IBinder::FIRST_CALL_TRANSACTION + 46, - HANDLEBLUETOOTHA2DPDEVICECONFIGCHANGE = IBinder::FIRST_CALL_TRANSACTION + 47, - STARTWATCHINGROUTES = IBinder::FIRST_CALL_TRANSACTION + 48, - ISCAMERASOUNDFORCED = IBinder::FIRST_CALL_TRANSACTION + 49, - SETVOLUMECONTROLLER = IBinder::FIRST_CALL_TRANSACTION + 50, - NOTIFYVOLUMECONTROLLERVISIBLE = IBinder::FIRST_CALL_TRANSACTION + 51, - ISSTREAMAFFECTEDBYRINGERMODE = IBinder::FIRST_CALL_TRANSACTION + 52, - ISSTREAMAFFECTEDBYMUTE = IBinder::FIRST_CALL_TRANSACTION + 53, - DISABLESAFEMEDIAVOLUME = IBinder::FIRST_CALL_TRANSACTION + 54, - SETHDMISYSTEMAUDIOSUPPORTED = IBinder::FIRST_CALL_TRANSACTION + 55, - ISHDMISYSTEMAUDIOSUPPORTED = IBinder::FIRST_CALL_TRANSACTION + 56, - REGISTERAUDIOPOLICY = IBinder::FIRST_CALL_TRANSACTION + 57, - UNREGISTERAUDIOPOLICYASYNC = IBinder::FIRST_CALL_TRANSACTION + 58, - SETFOCUSPROPERTIESFORPOLICY = IBinder::FIRST_CALL_TRANSACTION + 59, - SETVOLUMEPOLICY = IBinder::FIRST_CALL_TRANSACTION + 60, - REGISTERRECORDINGCALLBACK = IBinder::FIRST_CALL_TRANSACTION + 61, - UNREGISTERRECORDINGCALLBACK = IBinder::FIRST_CALL_TRANSACTION + 62, - GETACTIVERECORDINGCONFIGURATIONS = IBinder::FIRST_CALL_TRANSACTION + 63, - REGISTERPLAYBACKCALLBACK = IBinder::FIRST_CALL_TRANSACTION + 64, - UNREGISTERPLAYBACKCALLBACK = IBinder::FIRST_CALL_TRANSACTION + 65, - GETACTIVEPLAYBACKCONFIGURATIONS = IBinder::FIRST_CALL_TRANSACTION + 66, - */ - - TRACK_PLAYER = IBinder::FIRST_CALL_TRANSACTION + 67, - PLAYER_ATTRIBUTES = IBinder::FIRST_CALL_TRANSACTION + 68, - PLAYER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 69, - RELEASE_PLAYER = IBinder::FIRST_CALL_TRANSACTION + 70, - - /* - DISABLE_RINGTONE_SYNC = IBinder::FIRST_CALL_TRANSACTION + 71, - GET_FOCUS_RAMP_TIME_MS = IBinder::FIRST_CALL_TRANSACTION + 72, - DISPATCH_FOCUS_CHANGE = IBinder::FIRST_CALL_TRANSACTION + 73, - PLAYER_HAS_OP_PLAY_AUDIO = IBinder::FIRST_CALL_TRANSACTION + 74, - SET_BLUETOOTH_A2DP_DEVICE_CONNECTION_STATE_SUPPRESS_NOISY_INTENT - = IBinder::FIRST_CALL_TRANSACTION + 75, - */ + TRACK_PLAYER = IBinder::FIRST_CALL_TRANSACTION, + PLAYER_ATTRIBUTES = IBinder::FIRST_CALL_TRANSACTION + 1, + PLAYER_EVENT = IBinder::FIRST_CALL_TRANSACTION + 2, + RELEASE_PLAYER = IBinder::FIRST_CALL_TRANSACTION + 3, }; DECLARE_META_INTERFACE(AudioManager) diff --git a/include/audiomanager/IPlayer.h b/include/audiomanager/IPlayer.h deleted file mode 100644 index de5c1c7b64..0000000000 --- a/include/audiomanager/IPlayer.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_IPLAYER_H -#define ANDROID_IPLAYER_H - -#include <stdint.h> -#include <sys/types.h> - -#include <media/VolumeShaper.h> -#include <utils/RefBase.h> -#include <utils/Errors.h> -#include <binder/IInterface.h> - -namespace android { - -// ---------------------------------------------------------------------------- - -class IPlayer : public IInterface -{ -public: - DECLARE_META_INTERFACE(Player); - - virtual void start() = 0; - - virtual void pause() = 0; - - virtual void stop() = 0; - - virtual void setVolume(float vol) = 0; - - virtual void setPan(float pan) = 0; - - virtual void setStartDelayMs(int delayMs) = 0; - - virtual void applyVolumeShaper( - const sp<VolumeShaper::Configuration>& configuration, - const sp<VolumeShaper::Operation>& operation) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnPlayer : public BnInterface<IPlayer> -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IPLAYER_H diff --git a/include/input/InputEventLabels.h b/include/input/InputEventLabels.h index c282cf0b22..4b33a96adf 100644 --- a/include/input/InputEventLabels.h +++ b/include/input/InputEventLabels.h @@ -324,6 +324,7 @@ static const InputEventLabel KEYCODES[] = { DEFINE_KEYCODE(SYSTEM_NAVIGATION_LEFT), DEFINE_KEYCODE(SYSTEM_NAVIGATION_RIGHT), DEFINE_KEYCODE(ALL_APPS), + DEFINE_KEYCODE(REFRESH), { NULL, 0 } }; diff --git a/include/input/InputTransport.h b/include/input/InputTransport.h index ea1d2aa41f..1ea2c2cc07 100644 --- a/include/input/InputTransport.h +++ b/include/input/InputTransport.h @@ -31,7 +31,6 @@ #include <utils/Errors.h> #include <utils/Timers.h> #include <utils/RefBase.h> -#include <utils/String8.h> #include <utils/Vector.h> #include <utils/BitSet.h> @@ -142,16 +141,16 @@ protected: virtual ~InputChannel(); public: - InputChannel(const String8& name, int fd); + InputChannel(const std::string& name, int fd); /* Creates a pair of input channels. * * Returns OK on success. */ - static status_t openInputChannelPair(const String8& name, + static status_t openInputChannelPair(const std::string& name, sp<InputChannel>& outServerChannel, sp<InputChannel>& outClientChannel); - inline String8 getName() const { return mName; } + inline std::string getName() const { return mName; } inline int getFd() const { return mFd; } /* Sends a message to the other endpoint. @@ -183,7 +182,7 @@ public: sp<InputChannel> dup() const; private: - String8 mName; + std::string mName; int mFd; }; diff --git a/include/input/KeyCharacterMap.h b/include/input/KeyCharacterMap.h index 79359277c7..33d2757ec8 100644 --- a/include/input/KeyCharacterMap.h +++ b/include/input/KeyCharacterMap.h @@ -51,6 +51,9 @@ public: KEYBOARD_TYPE_PREDICTIVE = 2, KEYBOARD_TYPE_ALPHA = 3, KEYBOARD_TYPE_FULL = 4, + /** + * Deprecated. Set 'keyboard.specialFunction' to '1' in the device's IDC file instead. + */ KEYBOARD_TYPE_SPECIAL_FUNCTION = 5, KEYBOARD_TYPE_OVERLAY = 6, }; diff --git a/include/input/VelocityTracker.h b/include/input/VelocityTracker.h index 795f575a2e..ffa1614b55 100644 --- a/include/input/VelocityTracker.h +++ b/include/input/VelocityTracker.h @@ -264,6 +264,40 @@ private: Movement mMovements[HISTORY_SIZE]; }; +class ImpulseVelocityTrackerStrategy : public VelocityTrackerStrategy { +public: + ImpulseVelocityTrackerStrategy(); + virtual ~ImpulseVelocityTrackerStrategy(); + + virtual void clear(); + virtual void clearPointers(BitSet32 idBits); + virtual void addMovement(nsecs_t eventTime, BitSet32 idBits, + const VelocityTracker::Position* positions); + virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const; + +private: + // Sample horizon. + // We don't use too much history by default since we want to react to quick + // changes in direction. + static constexpr nsecs_t HORIZON = 100 * 1000000; // 100 ms + + // Number of samples to keep. + static constexpr size_t HISTORY_SIZE = 20; + + struct Movement { + nsecs_t eventTime; + BitSet32 idBits; + VelocityTracker::Position positions[MAX_POINTERS]; + + inline const VelocityTracker::Position& getPosition(uint32_t id) const { + return positions[idBits.getIndexOfBit(id)]; + } + }; + + size_t mIndex; + Movement mMovements[HISTORY_SIZE]; +}; + } // namespace android #endif // _LIBINPUT_VELOCITY_TRACKER_H diff --git a/include/layerproto b/include/layerproto new file mode 120000 index 0000000000..ef21a4eb8e --- /dev/null +++ b/include/layerproto @@ -0,0 +1 @@ +../services/surfaceflinger/layerproto/include/layerproto/
\ No newline at end of file |