diff options
4 files changed, 4 insertions, 64 deletions
diff --git a/services/core/java/com/android/server/tv/TvRemoteProviderProxy.java b/services/core/java/com/android/server/tv/TvRemoteProviderProxy.java index 557e9c8c8557..b27d5ea30c67 100644 --- a/services/core/java/com/android/server/tv/TvRemoteProviderProxy.java +++ b/services/core/java/com/android/server/tv/TvRemoteProviderProxy.java @@ -255,8 +255,6 @@ final class TvRemoteProviderProxy implements ServiceConnection { void clearInputBridge(TvRemoteProviderProxy provider, IBinder token); - void sendTimeStamp(TvRemoteProviderProxy provider, IBinder token, long timestamp); - void sendKeyDown(TvRemoteProviderProxy provider, IBinder token, int keyCode); void sendKeyUp(TvRemoteProviderProxy provider, IBinder token, int keyCode); @@ -400,24 +398,8 @@ final class TvRemoteProviderProxy implements ServiceConnection { } void sendTimestamp(final IBinder token, final long timestamp) { - synchronized (mLock) { - if (mActiveConnection == this && Binder.getCallingUid() == mUid) { - final long idToken = Binder.clearCallingIdentity(); - try { - if (mProviderMethods != null) { - mProviderMethods.sendTimeStamp(TvRemoteProviderProxy.this, token, - timestamp); - } - } finally { - Binder.restoreCallingIdentity(idToken); - } - } else { - if (DEBUG) { - Slog.w(TAG, - "sendTimeStamp, Invalid connection or incorrect uid: " + Binder - .getCallingUid()); - } - } + if (DEBUG) { + Slog.e(TAG, "sendTimestamp is deprecated, please remove all usages of this API."); } } diff --git a/services/core/java/com/android/server/tv/TvRemoteService.java b/services/core/java/com/android/server/tv/TvRemoteService.java index 961c9925414a..4a41bf8133c3 100644 --- a/services/core/java/com/android/server/tv/TvRemoteService.java +++ b/services/core/java/com/android/server/tv/TvRemoteService.java @@ -147,13 +147,6 @@ public class TvRemoteService extends SystemService implements Watchdog.Monitor { } } - private void sendTimeStampInternalLocked(IBinder token, long timestamp) { - UinputBridge inputBridge = mBridgeMap.get(token); - if (inputBridge != null) { - inputBridge.sendTimestamp(token, timestamp); - } - } - private void sendKeyDownInternalLocked(IBinder token, int keyCode) { if (DEBUG_KEYS) { Slog.d(TAG, "sendKeyDownInternalLocked(), token: " + token + ", keyCode: " + keyCode); @@ -298,15 +291,6 @@ public class TvRemoteService extends SystemService implements Watchdog.Monitor { } @Override - public void sendTimeStamp(TvRemoteProviderProxy provider, IBinder token, long timestamp) { - synchronized (mLock) { - if (mProviderList.contains(provider)) { - mService.sendTimeStampInternalLocked(token, timestamp); - } - } - } - - @Override public void sendKeyDown(TvRemoteProviderProxy provider, IBinder token, int keyCode) { if (DEBUG_KEYS) { Slog.d(TAG, "sendKeyDown(), token: " + token + ", keyCode: " + keyCode); diff --git a/services/core/java/com/android/server/tv/UinputBridge.java b/services/core/java/com/android/server/tv/UinputBridge.java index 1a984f98051f..752aa6683a88 100644 --- a/services/core/java/com/android/server/tv/UinputBridge.java +++ b/services/core/java/com/android/server/tv/UinputBridge.java @@ -16,13 +16,12 @@ package com.android.server.tv; -import android.os.Binder; import android.os.IBinder; -import java.io.IOException; - import dalvik.system.CloseGuard; +import java.io.IOException; + /** * Sends the input event to the linux driver. */ @@ -35,7 +34,6 @@ public final class UinputBridge { int maxPointers); private static native void nativeClose(long ptr); private static native void nativeClear(long ptr); - private static native void nativeSendTimestamp(long ptr, long timestamp); private static native void nativeSendKey(long ptr, int keyCode, boolean down); private static native void nativeSendPointerDown(long ptr, int pointerId, int x, int y); private static native void nativeSendPointerUp(long ptr, int pointerId); @@ -93,12 +91,6 @@ public final class UinputBridge { return mToken.equals(token); } - public void sendTimestamp(IBinder token, long timestamp) { - if (isTokenValid(token)) { - nativeSendTimestamp(mPtr, timestamp); - } - } - public void sendKeyDown(IBinder token, int keyCode) { if (isTokenValid(token)) { nativeSendKey(mPtr, keyCode, true /*down*/); diff --git a/services/core/jni/com_android_server_tv_TvUinputBridge.cpp b/services/core/jni/com_android_server_tv_TvUinputBridge.cpp index 980922a806f5..c832c18517ce 100644 --- a/services/core/jni/com_android_server_tv_TvUinputBridge.cpp +++ b/services/core/jni/com_android_server_tv_TvUinputBridge.cpp @@ -43,10 +43,6 @@ #include <sys/stat.h> #include <sys/types.h> -// Refer to EventHub.h -#define MSC_ANDROID_TIME_SEC 0x6 -#define MSC_ANDROID_TIME_USEC 0x7 - #define SLOT_UNKNOWN -1 namespace android { @@ -153,11 +149,6 @@ NativeConnection* NativeConnection::open(const char* name, const char* uniqueId, ioctl(fd, UI_SET_KEYBIT, KEYS[i].linuxKeyCode); } - // set the misc events maps - ioctl(fd, UI_SET_EVBIT, EV_MSC); - ioctl(fd, UI_SET_MSCBIT, MSC_ANDROID_TIME_SEC); - ioctl(fd, UI_SET_MSCBIT, MSC_ANDROID_TIME_USEC); - // register the input device if (write(fd, &uinp, sizeof(uinp)) != sizeof(uinp)) { ALOGE("Cannot write uinput_user_dev to fd %d: %s.", fd, strerror(errno)); @@ -200,13 +191,6 @@ static void nativeClose(JNIEnv* env, jclass clazz, jlong ptr) { delete connection; } -static void nativeSendTimestamp(JNIEnv* env, jclass clazz, jlong ptr, jlong timestamp) { - NativeConnection* connection = reinterpret_cast<NativeConnection*>(ptr); - - connection->sendEvent(EV_MSC, MSC_ANDROID_TIME_SEC, timestamp / 1000L); - connection->sendEvent(EV_MSC, MSC_ANDROID_TIME_USEC, (timestamp % 1000L) * 1000L); -} - static void nativeSendKey(JNIEnv* env, jclass clazz, jlong ptr, jint keyCode, jboolean down) { int32_t code = getLinuxKeyCode(keyCode); NativeConnection* connection = reinterpret_cast<NativeConnection*>(ptr); @@ -281,8 +265,6 @@ static JNINativeMethod gUinputBridgeMethods[] = { (void*)nativeOpen }, { "nativeClose", "(J)V", (void*)nativeClose }, - { "nativeSendTimestamp", "(JJ)V", - (void*)nativeSendTimestamp }, { "nativeSendKey", "(JIZ)V", (void*)nativeSendKey }, { "nativeSendPointerDown", "(JIII)V", |