首先在server上找到相应的提交,然后点击进去发现页面的右上角有个download选项,点击发现
Patch-File |
|
diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp
这样看就知道应该把patch放在services之上的目录也就是native,然后在native目录下这么搞
matthew@matthew:/media/matt2/8937-evb-1/frameworks/native$ git apply --reject < /media/matt2/8937-evb--1/frameworks/native/7a21c244.diff
<stdin>:48: trailing whitespace.
AKEY_EVENT_FLAG_FROM_SYSTEM | AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY);
<stdin>:76: trailing whitespace.
&&((mCurrentVirtualKey.keyCode == 4)||(mCurrentVirtualKey.keyCode == 187)))
<stdin>:90: trailing whitespace.
if (!isPointInsideSurface(pointer.x, pointer.y))
<stdin>:92: trailing whitespace.
<stdin>:100: trailing whitespace.
Checking patch services/inputflinger/InputReader.cpp...
Hunk #1 succeeded at 2739 (offset 3 lines).
Hunk #2 succeeded at 4236 (offset 3 lines).
Hunk #3 succeeded at 4287 (offset 3 lines).
Hunk #4 succeeded at 4297 (offset 3 lines).
Checking patch services/inputflinger/InputReader.h...
Applied patch services/inputflinger/InputReader.cpp cleanly.
Applied patch services/inputflinger/InputReader.h cleanly.
warning: squelched 5 whitespace errors
warning: 10 lines add whitespace errors.
matthew@matthew:/media/matt2/8937-evb-1/frameworks/native$ git status
# On branch qcom/8937/a601/evb
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: services/inputflinger/InputReader.cpp
# modified: services/inputflinger/InputReader.h
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# 7a21c244.diff
no changes added to commit (use "git add" and/or "git commit -a")
matthew@matthew:/media/matt2/8937-evb-1/frameworks/native$
这样就把服务器上的patch拉下来后打上去了