Skip to content

Commit

Permalink
gmscompat: skip location settings check activity when rerouting is on
Browse files Browse the repository at this point in the history
LocationSettingsCheckerActivity is launched by location service clients to ask the user to adjust
location settings. It's irrelevant when hybrid location service is enabled.
  • Loading branch information
muhomorr committed Mar 2, 2025
1 parent 955fbe0 commit a3bc946
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion core/java/com/android/internal/gmscompat/GmsHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,20 @@ public static void onActivityStart(int resultCode, Intent intent, int requestCod

// Activity#onCreate(Bundle)
public static void activityOnCreate(Activity activity) {

if (!GmsCompat.isGmsCore()) {
return;
}
if (activity.getClass().getName().equals("com.google.android.location.settings.LocationSettingsCheckerActivity")) {
try {
if (!GmsCompatApp.iGms2Gca().isHybridLocationServiceEnabled()) {
return;
}
} catch (RemoteException e) {
throw GmsCompatApp.callFailed(e);
}
Log.d(TAG, "hybrid location service is enabled, finishing LocationSettingsCheckerActivity");
activity.finish();
}
}

// ContentResolver#insert(Uri, ContentValues, Bundle)
Expand Down
2 changes: 2 additions & 0 deletions core/java/com/android/internal/gmscompat/IGms2Gca.aidl
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ interface IGms2Gca {
Notification getMediaProjectionNotification();

void raisePackageToForeground(String targetPkg, long durationMs, @nullable String reason, int reasonCode);

boolean isHybridLocationServiceEnabled();
}

0 comments on commit a3bc946

Please sign in to comment.