2

I want to programmatically clear the history of the android maps (and navigation) application.

I know there is a way to clear the browser history via

Browser.clearSearches(getContentResolver());

and the corresponding permission: com.android.browser.permission.WRITE_HISTORY_BOOKMARKS and this works fine (2.2.).

I couldn't find any way to clear the Maps-History though. Clearing the google/history online doesn't help either.

There are some apps in the market that promote to do that, so there must be an API for it, but i really couldn't find it yet.

I also messed around a bit with CLEAR_APP_CACHE and CLEAR_APP_USER_DATA but seems like they are signed/root-only permissions and delte too much anyways.

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
icyerasor
  • 4,973
  • 1
  • 43
  • 52

1 Answers1

2

Got a reply from Richard, developer of aClean:

To clear Google-Maps-Recent-Search-Suggestions:

SearchRecentSuggestions mapsrs = new SearchRecentSuggestions(this.getBaseContext(), "com.google.android.maps.SearchHistoryProvider", 1);
mapsrs.clearHistory();

Still doesn't clear recent destination of Navigation, tried but there seems to be no equivalent..?

IMPORTANT NOTE:

Once you do mapsrs.clearHistory(); Afterwards when the Maps-Application gets force-stopped afterwards, your Application will be killed, too. Probably I'm missing to unregister/unsync the Provider. But I have abandoned to try to reset it now anyways.

icyerasor
  • 4,973
  • 1
  • 43
  • 52
  • How you fixed the SecurityException? java.lang.SecurityException: Permission Denial: opening provider com.google.android.finsky.providers.RecentSuggestionsProvider – Juampa Jan 22 '15 at 08:09
  • I was developing a system signed app back then. Might not be fixable. – icyerasor Jan 22 '15 at 20:26