Loading core/jni/android_hardware_input_InputWindowHandle.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -163,10 +163,9 @@ bool NativeInputWindowHandle::updateInfo() { mInfo.touchOcclusionMode = static_cast<TouchOcclusionMode>( env->GetIntField(obj, gInputWindowHandleClassInfo.touchOcclusionMode)); mInfo.ownerPid = env->GetIntField(obj, gInputWindowHandleClassInfo.ownerPid); mInfo.ownerUid = env->GetIntField(obj, gInputWindowHandleClassInfo.ownerUid); mInfo.ownerPid = env->GetIntField(obj, gInputWindowHandleClassInfo.ownerPid); mInfo.ownerUid = gui::Uid{ static_cast<uid_t>(env->GetIntField(obj, gInputWindowHandleClassInfo.ownerUid))}; mInfo.packageName = getStringField(env, obj, gInputWindowHandleClassInfo.packageName, "<null>"); mInfo.displayId = env->GetIntField(obj, gInputWindowHandleClassInfo.displayId); Loading Loading @@ -309,7 +308,8 @@ jobject android_view_InputWindowHandle_fromWindowInfo(JNIEnv* env, gui::WindowIn env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.touchOcclusionMode, static_cast<int32_t>(windowInfo.touchOcclusionMode)); env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerPid, windowInfo.ownerPid); env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerUid, windowInfo.ownerUid); env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerUid, windowInfo.ownerUid.val()); ScopedLocalRef<jstring> packageName(env, env->NewStringUTF(windowInfo.packageName.data())); env->SetObjectField(inputWindowHandle, gInputWindowHandleClassInfo.packageName, packageName.get()); Loading services/core/jni/com_android_server_input_InputManagerService.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -356,7 +356,7 @@ public: void setPointerCapture(const PointerCaptureRequest& request) override; void notifyDropWindow(const sp<IBinder>& token, float x, float y) override; void notifyDeviceInteraction(int32_t deviceId, nsecs_t timestamp, const std::set<int32_t>& uids) override; const std::set<gui::Uid>& uids) override; /* --- PointerControllerPolicyInterface implementation --- */ Loading Loading @@ -969,7 +969,7 @@ void NativeInputManager::notifyDropWindow(const sp<IBinder>& token, float x, flo } void NativeInputManager::notifyDeviceInteraction(int32_t deviceId, nsecs_t timestamp, const std::set<int32_t>& uids) { const std::set<gui::Uid>& uids) { static const bool ENABLE_INPUT_DEVICE_USAGE_METRICS = sysprop::InputProperties::enable_input_device_usage_metrics().value_or(true); if (!ENABLE_INPUT_DEVICE_USAGE_METRICS) return; Loading Loading @@ -1864,7 +1864,8 @@ static jboolean nativeSetInTouchMode(JNIEnv* env, jobject nativeImplObj, jboolea jint pid, jint uid, jboolean hasPermission, jint displayId) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); return im->getInputManager()->getDispatcher().setInTouchMode(inTouchMode, pid, uid, return im->getInputManager()->getDispatcher().setInTouchMode(inTouchMode, pid, gui::Uid{static_cast<uid_t>(uid)}, hasPermission, displayId); } Loading @@ -1880,7 +1881,7 @@ static jint nativeInjectInputEvent(JNIEnv* env, jobject nativeImplObj, jobject i jint timeoutMillis, jint policyFlags) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); const std::optional<int32_t> targetUid = injectIntoUid ? std::make_optional(uid) : std::nullopt; const auto targetUid = injectIntoUid ? std::make_optional<gui::Uid>(uid) : std::nullopt; // static_cast is safe because the value was already checked at the Java layer InputEventInjectionSync mode = static_cast<InputEventInjectionSync>(syncMode); Loading Loading
core/jni/android_hardware_input_InputWindowHandle.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -163,10 +163,9 @@ bool NativeInputWindowHandle::updateInfo() { mInfo.touchOcclusionMode = static_cast<TouchOcclusionMode>( env->GetIntField(obj, gInputWindowHandleClassInfo.touchOcclusionMode)); mInfo.ownerPid = env->GetIntField(obj, gInputWindowHandleClassInfo.ownerPid); mInfo.ownerUid = env->GetIntField(obj, gInputWindowHandleClassInfo.ownerUid); mInfo.ownerPid = env->GetIntField(obj, gInputWindowHandleClassInfo.ownerPid); mInfo.ownerUid = gui::Uid{ static_cast<uid_t>(env->GetIntField(obj, gInputWindowHandleClassInfo.ownerUid))}; mInfo.packageName = getStringField(env, obj, gInputWindowHandleClassInfo.packageName, "<null>"); mInfo.displayId = env->GetIntField(obj, gInputWindowHandleClassInfo.displayId); Loading Loading @@ -309,7 +308,8 @@ jobject android_view_InputWindowHandle_fromWindowInfo(JNIEnv* env, gui::WindowIn env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.touchOcclusionMode, static_cast<int32_t>(windowInfo.touchOcclusionMode)); env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerPid, windowInfo.ownerPid); env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerUid, windowInfo.ownerUid); env->SetIntField(inputWindowHandle, gInputWindowHandleClassInfo.ownerUid, windowInfo.ownerUid.val()); ScopedLocalRef<jstring> packageName(env, env->NewStringUTF(windowInfo.packageName.data())); env->SetObjectField(inputWindowHandle, gInputWindowHandleClassInfo.packageName, packageName.get()); Loading
services/core/jni/com_android_server_input_InputManagerService.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -356,7 +356,7 @@ public: void setPointerCapture(const PointerCaptureRequest& request) override; void notifyDropWindow(const sp<IBinder>& token, float x, float y) override; void notifyDeviceInteraction(int32_t deviceId, nsecs_t timestamp, const std::set<int32_t>& uids) override; const std::set<gui::Uid>& uids) override; /* --- PointerControllerPolicyInterface implementation --- */ Loading Loading @@ -969,7 +969,7 @@ void NativeInputManager::notifyDropWindow(const sp<IBinder>& token, float x, flo } void NativeInputManager::notifyDeviceInteraction(int32_t deviceId, nsecs_t timestamp, const std::set<int32_t>& uids) { const std::set<gui::Uid>& uids) { static const bool ENABLE_INPUT_DEVICE_USAGE_METRICS = sysprop::InputProperties::enable_input_device_usage_metrics().value_or(true); if (!ENABLE_INPUT_DEVICE_USAGE_METRICS) return; Loading Loading @@ -1864,7 +1864,8 @@ static jboolean nativeSetInTouchMode(JNIEnv* env, jobject nativeImplObj, jboolea jint pid, jint uid, jboolean hasPermission, jint displayId) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); return im->getInputManager()->getDispatcher().setInTouchMode(inTouchMode, pid, uid, return im->getInputManager()->getDispatcher().setInTouchMode(inTouchMode, pid, gui::Uid{static_cast<uid_t>(uid)}, hasPermission, displayId); } Loading @@ -1880,7 +1881,7 @@ static jint nativeInjectInputEvent(JNIEnv* env, jobject nativeImplObj, jobject i jint timeoutMillis, jint policyFlags) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); const std::optional<int32_t> targetUid = injectIntoUid ? std::make_optional(uid) : std::nullopt; const auto targetUid = injectIntoUid ? std::make_optional<gui::Uid>(uid) : std::nullopt; // static_cast is safe because the value was already checked at the Java layer InputEventInjectionSync mode = static_cast<InputEventInjectionSync>(syncMode); Loading