• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How do I find if I have background location services? I only use ACCESS_FINE_LOCATION foreground

I'm currently struggling with being compliant with new google play policies regarding localization permission.

I developed an app to call emergency numbers from (almost) any country in the world and I have a feature that allows the user to click on a button to locate himself and display the corresponding emergency numbers of the country he is in.

My issue is that Google sent me an email to reject my app because I quote : "Feature does not meet requirements for background location access".
The thing is : I do not ask for background location access, so I do not know what to do... I ask for "ACCESS_FINE_LOCATION" and I start a service declared as foreground.

Here is my manifest :

Code:
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.CALL_PHONE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/er"
        android:label="@string/app_name"
        android:roundIcon="@drawable/er"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:windowSoftInputMode="adjustPan"
        android:screenOrientation="portrait">

        <service
            android:name=".LocationService"
            android:enabled="true"
            android:description="@string/emergency_localization"
            android:foregroundServiceType="location"
            android:icon="@drawable/er"
            android:label="@string/emergency_localization_label"
            android:permission="android.permission.FOREGROUND_SERVICE"/>

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

    <uses-feature
        android:name="android.location.Geocoder"
        android:required="false" />

And the code plugged to the localization button :

Code:
            findMeBtn.setOnClickListener(v -> {
            if (!PermissionNeeded()) {
                DisplayIcon(true);
                locationIntent = new Intent(getApplicationContext(), LocationService.class);
                startService((locationIntent));
            }
        });

I asked for more information to Google, and the only answer was :

"We have re-reviewed your app, but your declared feature still does not meet the requirements to access location in the background because of the following reason(s):

Users may not expect the app to access their location in the background
It is possible to deliver a similar experience without access to location in the background"

Thank you very much Google for being more explicit...

I saw afterwards that I was not stoping the service in the onPause method in the main activity, so I added this and tried to publish it again, but same error, apparently I am still asking a background service permission, without currently asking it ...

Code:
@Override
public void onPause() {
    super.onPause();
    if (locationIntent != null) stopService(locationIntent);
}

@Override
public void onDestroy() {
    super.onDestroy();
    unregisterReceiver(broadcastReceiver);
    if (locationIntent != null) stopService(locationIntent);
}

So I'm pretty sure I'm missing something obvious somewhere, but since I have no idea where to look at, I really need a new pair of eyes on it... I am now losing faith on this app's future...

Thanks a lot by advance !
 
Last edited:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones