it's quite tricky solution, but you can do it by following steps:
Step1: Google places allows you only biasing search results from specified LatLngBounds (in your case city bounds), but search engine may still return Place outside given bounds. See Restrict autocomplete results for more details. I think this is sufficient, but if you need strict restriction, follow step2.
Step2: With all search results from Step1 call Places.GeoDataApi.getPlaceById to get detail info about each Place. You'll get among other things LatLng of each place. Then you can check if each Place lies within given bounds: bounds.contains(LatLng)
and if not, remove it manually from search results.
HOWEVER: Step2 solution multiplies number of requests on PlacesAPI and you should think twice if you really need this strict restriction!
UPDATE
As of April 2018 Google added possibility to specify how to treat the bounds in autocomplete predictions. Now you can use the getAutocompletePredictions()
method of GeoDataClient
class with boundsMode
parameter.
See https://stackoverflow.com/a/50134855/5140781 for more details.