当前位置: 代码迷 >> 综合 >> android 陌生人电话不显示其归属地
  详细解决方案

android 陌生人电话不显示其归属地

热度:50   发布时间:2024-01-19 17:34:42.0

  修改DefaultCallLogInsertionHelper.java (alps\packages\providers\contactsprovider\src\com\android\providers\contacts)

    @Override

    public void addComputedValues(ContentValues values) {

        // Insert the current country code, so we know the country the number belongs to.

        String countryIso = getCurrentCountryIso();

        /// M: @{

        Log.d(TAG, "addComputedValues() countryIso == [" + countryIso +"]");

        Log.d(TAG, "addComputedValues() geocoded == [" + getGeocodedLocationFor(values.getAsString(Calls.NUMBER), countryIso) +"]");

        /// @}

        values.put(Calls.COUNTRY_ISO, countryIso);

        // Insert the geocoded location, so that we do not need to compute it on the fly.

        //mtk add

        String name = values.getAsString(Calls.NAME);

        if(name == null || name.equals("")){

            return;

        }

        //mtk add end     

        values.put(Calls.GEOCODED_LOCATION,

                getGeocodedLocationFor(values.getAsString(Calls.NUMBER), countryIso));

    }

  相关解决方案