【发布时间】:2019-12-02 21:52:53
【问题描述】:
我正在使用 Android 类 CallScreeningService onScreenCall(Call.Details calldetails) 来获取所有来电,一切正常!从现在开始我有一个错误,在 Android 10 设备上,函数 calldetails.getExras() 和 calldetails.getIntentExtras() 总是返回 NULL,而不是 Bundle,我可以在其中阅读更多信息。在 Android 9 和更早版本的设备上一切正常。
有人有类似的问题吗?这是源代码和一些声明:
public class IncomingCallService extends CallScreeningService {
@Override
public void onScreenCall(Call.Details callDetails) {
if (callDetails.getExtras() != null) {
Log.d(LOG_TAG, "Everything works on Android 9 or older");
}else{
Log.d(LOG_TAG, "Its Null on Android 10!");
}
if (callDetails.getIntentExtras() != null) {
Log.d(LOG_TAG, "Everything works on Android 9 or older");
}else{
Log.d(LOG_TAG, "Its Null on Android 10!");
}
}
和 Manifest.xml:
<service android:name=".call_handler.IncomingCallService"
android:permission="android.permission.BIND_SCREENING_SERVICE">
<intent-filter>
<action android:name="android.telecom.CallScreeningService"/>
</intent-filter>
</service>
【问题讨论】:
-
谁有一些信息?
标签: android bundle phone-call android-10.0