[Q] AOSP build from SOURCE. Network Positioning don't work. NEED HELP.

Search This thread

bariz143

Senior Member
Dec 11, 2009
2,229
413
Samsung Galaxy Z Fold 5
Hi guys. Its like the 10th thread from me lately. Appreciate all the help getting from you.

I have compiled my first ROM and i had a lot of issues with it. And with your help a lot got fixed. The ROM works 99.9 %.

I only have one more problem with the ROM and its the NETWORK POSITIONING that seems to not working.

And i really need it because i use maps and weather app constantly. Without the NETWORK POSITIONING those apps don't work.

It just waits for gps all the time. I did compile CM11 and it works like a charm. But i dont want cm11

AOSP is more like my taste and i can add all the features i want without messing with CM11 pre compiled stuff.

So if someone could point me in the right direction would be very appreciated .

Cheers.
 

theesotericone

Senior Member
Sep 22, 2013
1,458
2,423
If the build compiled without errors I'd first look at your APNs. If your getting cell service that should be enough to get location as well. Just some thoughts.
 

KedarWolf

Senior Member
Apr 27, 2012
295
157
AOSP Build That Works With GPS

My apns is correct and yes i have cell service of course :)

http://xdaforums.com/google-nexus-5/general/guide-how-to-build-aosp-source-linux-t2703036

This is my guide for the latest build of AOSP (KVT49L) with several bug fixes over the old 4.4.2 build. I just used 'GPS Test And Fix' app from the Play Store and the GPS finds 20 satellites and works in Google Maps. I did use the 'Reset GPS' and 'Download Xtra Data' options in the app and then GPS worked fine.

Hope that helps. :D

P.S. Often I have trouble when indoors with my Nexus 5 finding satellites so you might want to go outside and test see if the GPS works there.
 
Last edited:
  • Like
Reactions: bariz143

bariz143

Senior Member
Dec 11, 2009
2,229
413
Samsung Galaxy Z Fold 5
http://xdaforums.com/google-nexus-5/general/guide-how-to-build-aosp-source-linux-t2703036

This is my guide for the latest build of AOSP (KVT49L) with several bug fixes over the old 4.4.2 build. I just used 'GPS Test And Fix' app from the Play Store and the GPS finds 20 satellites and works in Google Maps. I did use the 'Reset GPS' and 'Download Xtra Data' options in the app and then GPS worked fine.

Hope that helps. :D

P.S. Often I have trouble when indoors with my Nexus 5 finding satellites so you might want to go outside and test see if the GPS works there.


HI man. Yeah its your tutorial that I am using. I don't have gps issues I'm having network positioning issues. Now I am on stock ROM and when I open let's say Google Maps it knows where I am instantly. But when I use my OWN compiled ROM it just shows the country and not Street. I don't know how to explain but I hope you get it.
 

xdajeyk

New member
Feb 5, 2011
2
2
I am experiencing exactly the same problem with a fresh, clean, by-the-book, build of AOSP 4.4.2. I am on a Nexus 4 though.

GPS works perfectly, but Network Positioning (GPS disabled, or GPS enabled but indoors) doesn't. I have been trying to fix this issue for the past few days now, but have made no progress. Using either the 4.4.2 stock ROM or CM11, both GPS and Network Positioning work.

I am suspecting that the binary blobs are missing a file that is needed for network positioning to work, but I haven't been able to figure out which one.
 

mbroeders

Senior Member
May 6, 2010
959
221
Amsterdam
So, your problem reminded me of something i ran into a few years ago. I haven't build my own rom in a while, so i'm not sure sure whether this helps, but maybe it does:

Search for the lines in frameworks/base/core/res/res/values/config.xml that say:

Code:
 <string-array name="config_locationProviderPackageNames" translatable="false">
        <!-- The standard AOSP fused location provider -->
        <item>com.android.location.fused</item>
    </string-array>

And change this into:
Code:
<string-array name="config_locationProviderPackageNames" translatable="false">
        <!-- The Google provider -->
        <item>com.google.android.gms</item>
        <!-- The standard AOSP fused location provider -->
        <item>com.android.location.fused</item>
    </string-array>

That may fix your problem, it did for me a while ago. Good luck building!
 

xdajeyk

New member
Feb 5, 2011
2
2
@mbroeders Thanks, that does indeed fix the problem. Actually, I found that solution a few hours ago by browsing around in the device tree sample inside the sources. The sample files contain an overlay file that does exactly the same. To keep in line with the sample, I also made the change inside the device tree at
Code:
device/lge/mako/overlay/frameworks/base/core/res/res/values/config.xml
. Or, @bariz143, for the Nexus 5 that file should be
Code:
device/lge/hammerhead/overlay/frameworks/base/core/res/res/values/config.xml
.

I did not, however, find a detailed explanation of what is actually going on here and why it doesn't work out of the box, so I tried to figure it out myself, mainly from the comments in that sample file and some googling around. I am recording my findings here because I believe it will help other Android n00bs like myself.
Apparently, the network location provider is not part of AOSP, but instead is distributed together with the Google Apps. To get network location to work, you need to tell the framework that it is OK to use location providers provided by Google. It does not do that by default, because they (obviously!) are signed with a different key than the one used to sign the AOSP you just built. So, by adding
Code:
<item>com.google.android.gms</item>
into config.xml, you are telling the framework that it's OK to use location providers that are signed with the same key as the APK that provides the
Code:
com.google.android.gms
app, which apparently is the app that contains the network location provider.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    So, your problem reminded me of something i ran into a few years ago. I haven't build my own rom in a while, so i'm not sure sure whether this helps, but maybe it does:

    Search for the lines in frameworks/base/core/res/res/values/config.xml that say:

    Code:
     <string-array name="config_locationProviderPackageNames" translatable="false">
            <!-- The standard AOSP fused location provider -->
            <item>com.android.location.fused</item>
        </string-array>

    And change this into:
    Code:
    <string-array name="config_locationProviderPackageNames" translatable="false">
            <!-- The Google provider -->
            <item>com.google.android.gms</item>
            <!-- The standard AOSP fused location provider -->
            <item>com.android.location.fused</item>
        </string-array>

    That may fix your problem, it did for me a while ago. Good luck building!
    2
    @mbroeders Thanks, that does indeed fix the problem. Actually, I found that solution a few hours ago by browsing around in the device tree sample inside the sources. The sample files contain an overlay file that does exactly the same. To keep in line with the sample, I also made the change inside the device tree at
    Code:
    device/lge/mako/overlay/frameworks/base/core/res/res/values/config.xml
    . Or, @bariz143, for the Nexus 5 that file should be
    Code:
    device/lge/hammerhead/overlay/frameworks/base/core/res/res/values/config.xml
    .

    I did not, however, find a detailed explanation of what is actually going on here and why it doesn't work out of the box, so I tried to figure it out myself, mainly from the comments in that sample file and some googling around. I am recording my findings here because I believe it will help other Android n00bs like myself.
    Apparently, the network location provider is not part of AOSP, but instead is distributed together with the Google Apps. To get network location to work, you need to tell the framework that it is OK to use location providers provided by Google. It does not do that by default, because they (obviously!) are signed with a different key than the one used to sign the AOSP you just built. So, by adding
    Code:
    <item>com.google.android.gms</item>
    into config.xml, you are telling the framework that it's OK to use location providers that are signed with the same key as the APK that provides the
    Code:
    com.google.android.gms
    app, which apparently is the app that contains the network location provider.
    1
    AOSP Build That Works With GPS

    My apns is correct and yes i have cell service of course :)

    http://xdaforums.com/google-nexus-5/general/guide-how-to-build-aosp-source-linux-t2703036

    This is my guide for the latest build of AOSP (KVT49L) with several bug fixes over the old 4.4.2 build. I just used 'GPS Test And Fix' app from the Play Store and the GPS finds 20 satellites and works in Google Maps. I did use the 'Reset GPS' and 'Download Xtra Data' options in the app and then GPS worked fine.

    Hope that helps. :D

    P.S. Often I have trouble when indoors with my Nexus 5 finding satellites so you might want to go outside and test see if the GPS works there.