2017-09-22 94 views
7

我想修改AOSP(主分支)中的FingerprintGestureController API來返回布爾值而不是void,但即使在重新編譯SDK之後,我仍然在構建項目時出現錯誤。在AOSP中修改SDK API

錯誤是:

FAILED: out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp 
/bin/bash -c "((out/host/linux-x86/bin/apicheck -JXmx1024m -J\"classpath /usr/lib/jvm/java-8-openjdk-amd64/bin/../lib/tools.jar:out/host/linux-x86/framework/doclava.jar:out/host/linux-x86/framework/jsilver.jar\" -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18 prebuilts/sdk/api/26.txt out/target/common/obj/PACKAGING/public_api.txt frameworks/base/api/removed.txt out/target/common/obj/PACKAGING/removed.txt || ( cat build/core/apicheck_msg_last.txt ; exit 38))) && (mkdir -p out/target/common/obj/PACKAGING/) && (touch out/target/common/obj/PACKAGING/checkpublicapi-last-timestamp)" 
out/target/common/obj/PACKAGING/public_api.txt:2874: error 16: Method android.accessibilityservice.FingerprintGestureController.FingerprintGestureCallback.onGestureDetected(int) has changed return type from Primitive?: true TypeVariable?: false Wildcard?: false Dimension: QualifedTypeName: void to Primitive?: true TypeVariable?: false Wildcard?: false Dimension: QualifedTypeName: boolean 

****************************** 
You have tried to change the API from what has been previously released in 
an SDK. Please fix the errors listed above. 
****************************** 

步驟我跟着編譯如下:

lunch sdk-eng 
make update-api //Success 
make sdk   //Success 
lunch 1 
make -j10  //Errors out here 

可有人請引導我如何更改源代碼發佈的SDK API的Android的和編譯機器人。

+0

'onGestureDetected'是一個接口回調。通過將其設置爲布爾返回類型並試圖阻止方法調用獲得什麼目的? –

+0

我想知道接收指紋手勢回調的應用是否已經消費了該事件,類似於View的onTouch事件。 – user531069

+0

爲什麼不呢?如果設備沒有指紋傳感器? –

回答

2

您需要確保下列文件已與您的方法簽名的變化更新時間:

/frameworks/base/api/current.txt 
/frameworks/base/api/system-current.txt 
/frameworks/base/api/test-current.txt 
+0

這些文件已經更新並顯示更新後的api。另外我提到make update-api並使sdk成功。 – user531069