From 3e734308ef5de466a5c7a646a9f8287bf3cbccd0 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 27 Apr 2014 02:07:38 +0200 Subject: [PATCH] Implement more interfaces (as dummy) Enough to let sample app run without uncatched exception --- README.md | 21 +++ .../gms/maps/internal/GoogleMapImpl.java | 8 +- .../gms/maps/model/internal/CircleImpl.java | 126 ++++++++++++++ .../model/internal/GroundOverlayImpl.java | 144 ++++++++++++++++ .../maps/model/internal/ICircleDelegate.aidl | 20 +++ .../internal/IGroundOverlayDelegate.aidl | 25 +++ .../maps/model/internal/IMarkerDelegate.aidl | 29 ++++ .../maps/model/internal/IPolygonDelegate.aidl | 23 +++ .../gms/maps/model/internal/MarkerImpl.java | 157 ++++++++++++++++++ .../gms/maps/model/internal/PolygonImpl.java | 139 ++++++++++++++++ .../gms/maps/model/internal/PolylineImpl.java | 5 +- .../GoogleLocationManagerService.java | 27 ++- 12 files changed, 710 insertions(+), 14 deletions(-) create mode 100644 README.md create mode 100644 src/com/google/android/gms/maps/model/internal/CircleImpl.java create mode 100644 src/com/google/android/gms/maps/model/internal/GroundOverlayImpl.java create mode 100644 src/com/google/android/gms/maps/model/internal/MarkerImpl.java create mode 100644 src/com/google/android/gms/maps/model/internal/PolygonImpl.java diff --git a/README.md b/README.md new file mode 100644 index 00000000..d43ff27e --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +GmsCore +======= +Implementation of the "Play Services" library application. + +More details follow. + +License +------- + Copyright 2014 μg Project Team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/src/com/google/android/gms/maps/internal/GoogleMapImpl.java b/src/com/google/android/gms/maps/internal/GoogleMapImpl.java index 52a76b41..af154577 100644 --- a/src/com/google/android/gms/maps/internal/GoogleMapImpl.java +++ b/src/com/google/android/gms/maps/internal/GoogleMapImpl.java @@ -131,17 +131,17 @@ public class GoogleMapImpl { @Override public IPolygonDelegate addPolygon(PolygonOptions options) throws RemoteException { - return null; + return new PolygonImpl(options); } @Override public IMarkerDelegate addMarker(MarkerOptions options) throws RemoteException { - return null; + return new MarkerImpl(options); } @Override public IGroundOverlayDelegate addGroundOverlay(GroundOverlayOptions options) throws RemoteException { - return null; + return new GroundOverlayImpl(options); } @Override @@ -281,7 +281,7 @@ public class GoogleMapImpl { @Override public ICircleDelegate addCircle(CircleOptions options) throws RemoteException { - return null; + return new CircleImpl(options); } @Override diff --git a/src/com/google/android/gms/maps/model/internal/CircleImpl.java b/src/com/google/android/gms/maps/model/internal/CircleImpl.java new file mode 100644 index 00000000..103e7723 --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/CircleImpl.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2014 μg Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model.internal; + +import android.os.RemoteException; +import com.google.android.gms.maps.model.CircleOptions; +import com.google.android.gms.maps.model.LatLng; + +public class CircleImpl extends ICircleDelegate.Stub { + private LatLng center; + private double radius; + private float zIndex; + private boolean visible; + private String id; + private float strokeWidth; + private int strokeColor; + private int fillColor; + + public CircleImpl(CircleOptions options) { + + } + + @Override + public void remove() throws RemoteException { + + } + + @Override + public String getId() throws RemoteException { + return id; + } + + @Override + public void setCenter(LatLng center) throws RemoteException { + this.center = center; + } + + @Override + public LatLng getCenter() throws RemoteException { + return center; + } + + @Override + public void setRadius(double radius) throws RemoteException { + this.radius = radius; + } + + @Override + public double getRadius() throws RemoteException { + return radius; + } + + @Override + public void setStrokeWidth(float width) throws RemoteException { + this.strokeWidth = width; + } + + @Override + public float getStrokeWidth() throws RemoteException { + return strokeWidth; + } + + @Override + public void setStrokeColor(int color) throws RemoteException { + this.strokeColor = color; + } + + @Override + public int getStrokeColor() throws RemoteException { + return strokeColor; + } + + @Override + public void setFillColor(int color) throws RemoteException { + this.fillColor = color; + } + + @Override + public int getFillColor() throws RemoteException { + return fillColor; + } + + @Override + public void setZIndex(float zIndex) throws RemoteException { + this.zIndex = zIndex; + } + + @Override + public float getZIndex() throws RemoteException { + return zIndex; + } + + @Override + public void setVisible(boolean visible) throws RemoteException { + this.visible = visible; + } + + @Override + public boolean isVisible() throws RemoteException { + return visible; + } + + @Override + public boolean equalsRemote(ICircleDelegate other) throws RemoteException { + return other.getId().equals(getId()); + } + + @Override + public int hashCodeRemote() throws RemoteException { + return id.hashCode(); + } +} diff --git a/src/com/google/android/gms/maps/model/internal/GroundOverlayImpl.java b/src/com/google/android/gms/maps/model/internal/GroundOverlayImpl.java new file mode 100644 index 00000000..70dde6ce --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/GroundOverlayImpl.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2014 μg Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model.internal; + +import android.os.RemoteException; +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.GroundOverlayOptions; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + +public class GroundOverlayImpl extends IGroundOverlayDelegate.Stub { + private LatLng position; + private float transparency; + private float zIndex; + private boolean visible; + private String id; + private float width; + private float height; + private float bearing; + + public GroundOverlayImpl(GroundOverlayOptions options) { + + } + + @Override + public void remove() throws RemoteException { + + } + + @Override + public String getId() throws RemoteException { + return id; + } + + @Override + public void setPosition(LatLng pos) throws RemoteException { + this.position = pos; + } + + @Override + public LatLng getPosition() throws RemoteException { + return position; + } + + @Override + public void setDimension(float dimension) throws RemoteException { + setDimensions(dimension, dimension); + } + + @Override + public void setDimensions(float width, float height) throws RemoteException { + this.width = width; + this.height = height; + } + + @Override + public float getWidth() throws RemoteException { + return width; + } + + @Override + public float getHeight() throws RemoteException { + return height; + } + + @Override + public void setPositionFromBounds(LatLngBounds bounds) throws RemoteException { + + } + + @Override + public LatLngBounds getBounds() throws RemoteException { + return null; + } + + @Override + public void setBearing(float bearing) throws RemoteException { + this.bearing = bearing; + } + + @Override + public float getBearing() throws RemoteException { + return bearing; + } + + @Override + public void setZIndex(float zIndex) throws RemoteException { + this.zIndex = zIndex; + } + + @Override + public float getZIndex() throws RemoteException { + return zIndex; + } + + @Override + public void setVisible(boolean visible) throws RemoteException { + this.visible = visible; + } + + @Override + public boolean isVisible() throws RemoteException { + return visible; + } + + @Override + public void setTransparency(float transparency) throws RemoteException { + this.transparency = transparency; + } + + @Override + public float getTransparency() throws RemoteException { + return transparency; + } + + @Override + public boolean equalsRemote(IGroundOverlayDelegate other) throws RemoteException { + return other.getId().equals(getId()); + } + + @Override + public int hashCodeRemote() throws RemoteException { + return id.hashCode(); + } + + @Override + public void todo(IObjectWrapper obj) throws RemoteException { + + } +} diff --git a/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl b/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl index c43d310a..719d8eab 100644 --- a/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl +++ b/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl @@ -1,4 +1,24 @@ package com.google.android.gms.maps.model.internal; +import com.google.android.gms.maps.model.LatLng; + interface ICircleDelegate { + void remove(); + String getId(); + void setCenter(in LatLng center); + LatLng getCenter(); + void setRadius(double radius); + double getRadius(); + void setStrokeWidth(float width); + float getStrokeWidth(); + void setStrokeColor(int color); + int getStrokeColor(); + void setFillColor(int color); + int getFillColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + boolean equalsRemote(ICircleDelegate other); + int hashCodeRemote(); } diff --git a/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl index ea034a18..0a1a0632 100644 --- a/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl +++ b/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl @@ -1,4 +1,29 @@ package com.google.android.gms.maps.model.internal; +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + interface IGroundOverlayDelegate { + void remove(); + String getId(); + void setPosition(in LatLng pos); + LatLng getPosition(); + void setDimension(float dimension); + void setDimensions(float width, float height); + float getWidth(); + float getHeight(); + void setPositionFromBounds(in LatLngBounds bounds); + LatLngBounds getBounds(); + void setBearing(float bearing); + float getBearing(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setTransparency(float transparency); + float getTransparency(); + boolean equalsRemote(IGroundOverlayDelegate other); + int hashCodeRemote(); + void todo(IObjectWrapper obj); } diff --git a/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl index 4a9e9eff..aa1173c3 100644 --- a/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl +++ b/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl @@ -1,4 +1,33 @@ package com.google.android.gms.maps.model.internal; +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; + interface IMarkerDelegate { + void remove(); + String getId(); + void setPosition(in LatLng pos); + LatLng getPosition(); + void setTitle(String title); + String getTitle(); + void setSnippet(String title); + String getSnippet(); + void setDraggable(boolean drag); + boolean isDraggable(); + void showInfoWindow(); + void hideInfoWindow(); + boolean isInfoWindowShown(); + void setVisible(boolean visible); + boolean isVisible(); + boolean equalsRemote(IMarkerDelegate other); + int hashCodeRemote(); + void todo(IObjectWrapper obj); + void setAnchor(float x, float y); + void setFlat(boolean flat); + boolean isFlat(); + void setRotation(float rotation); + float getRotation(); + void setInfoWindowAnchor(float x, float y); + void setAlpha(float alpha); + float getAlpha(); } diff --git a/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl index c455f15b..67f0517b 100644 --- a/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl +++ b/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl @@ -1,4 +1,27 @@ package com.google.android.gms.maps.model.internal; +import com.google.android.gms.maps.model.LatLng; + interface IPolygonDelegate { + void remove(); + String getId(); + void setPoints(in List points); + List getPoints(); + void setHoles(in List holes); + List getHoles(); + void setStrokeWidth(float width); + float getStrokeWidth(); + void setStrokeColor(int color); + int getStrokeColor(); + void setFillColor(int color); + int getFillColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setGeodesic(boolean geod); + boolean isGeodesic(); + boolean equalsRemote(IPolygonDelegate other); + int hashCodeRemote(); + } diff --git a/src/com/google/android/gms/maps/model/internal/MarkerImpl.java b/src/com/google/android/gms/maps/model/internal/MarkerImpl.java new file mode 100644 index 00000000..f44e0a76 --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/MarkerImpl.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2014 μg Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model.internal; + +import android.os.RemoteException; +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.MarkerOptions; + +public class MarkerImpl extends IMarkerDelegate.Stub { + public MarkerImpl(MarkerOptions options) { + } + + @Override + public void remove() throws RemoteException { + + } + + @Override + public String getId() throws RemoteException { + return null; + } + + @Override + public void setPosition(LatLng pos) throws RemoteException { + + } + + @Override + public LatLng getPosition() throws RemoteException { + return null; + } + + @Override + public void setTitle(String title) throws RemoteException { + + } + + @Override + public String getTitle() throws RemoteException { + return null; + } + + @Override + public void setSnippet(String title) throws RemoteException { + + } + + @Override + public String getSnippet() throws RemoteException { + return null; + } + + @Override + public void setDraggable(boolean drag) throws RemoteException { + + } + + @Override + public boolean isDraggable() throws RemoteException { + return false; + } + + @Override + public void showInfoWindow() throws RemoteException { + + } + + @Override + public void hideInfoWindow() throws RemoteException { + + } + + @Override + public boolean isInfoWindowShown() throws RemoteException { + return false; + } + + @Override + public void setVisible(boolean visible) throws RemoteException { + + } + + @Override + public boolean isVisible() throws RemoteException { + return false; + } + + @Override + public boolean equalsRemote(IMarkerDelegate other) throws RemoteException { + return false; + } + + @Override + public int hashCodeRemote() throws RemoteException { + return 0; + } + + @Override + public void todo(IObjectWrapper obj) throws RemoteException { + + } + + @Override + public void setAnchor(float x, float y) throws RemoteException { + + } + + @Override + public void setFlat(boolean flat) throws RemoteException { + + } + + @Override + public boolean isFlat() throws RemoteException { + return false; + } + + @Override + public void setRotation(float rotation) throws RemoteException { + + } + + @Override + public float getRotation() throws RemoteException { + return 0; + } + + @Override + public void setInfoWindowAnchor(float x, float y) throws RemoteException { + + } + + @Override + public void setAlpha(float alpha) throws RemoteException { + + } + + @Override + public float getAlpha() throws RemoteException { + return 0; + } +} diff --git a/src/com/google/android/gms/maps/model/internal/PolygonImpl.java b/src/com/google/android/gms/maps/model/internal/PolygonImpl.java new file mode 100644 index 00000000..4791ae84 --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/PolygonImpl.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2014 μg Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model.internal; + +import android.os.RemoteException; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.PolygonOptions; + +import java.util.List; + +public class PolygonImpl extends IPolygonDelegate.Stub { + private List points; + private List holes; + private float zIndex; + private boolean geodesic; + private boolean visible; + private String id; + private float strokeWidth; + private int strokeColor; + private int fillColor; + + public PolygonImpl(PolygonOptions options) { + + } + + @Override + public void remove() throws RemoteException { + + } + + @Override + public String getId() throws RemoteException { + return id; + } + + @Override + public void setPoints(List points) throws RemoteException { + this.points = points; + } + + @Override + public List getPoints() throws RemoteException { + return points; + } + + @Override + public void setHoles(List holes) throws RemoteException { + this.holes = holes; + } + + @Override + public List getHoles() throws RemoteException { + return holes; + } + + @Override + public void setStrokeWidth(float width) throws RemoteException { + this.strokeWidth = width; + } + + @Override + public float getStrokeWidth() throws RemoteException { + return strokeWidth; + } + + @Override + public void setStrokeColor(int color) throws RemoteException { + this.strokeColor = color; + } + + @Override + public int getStrokeColor() throws RemoteException { + return strokeColor; + } + + @Override + public void setFillColor(int color) throws RemoteException { + this.fillColor = color; + } + + @Override + public int getFillColor() throws RemoteException { + return fillColor; + } + + @Override + public void setZIndex(float zIndex) throws RemoteException { + this.zIndex = zIndex; + } + + @Override + public float getZIndex() throws RemoteException { + return zIndex; + } + + @Override + public void setVisible(boolean visible) throws RemoteException { + this.visible = visible; + } + + @Override + public boolean isVisible() throws RemoteException { + return visible; + } + + @Override + public void setGeodesic(boolean geod) throws RemoteException { + this.geodesic = geod; + } + + @Override + public boolean isGeodesic() throws RemoteException { + return geodesic; + } + + @Override + public boolean equalsRemote(IPolygonDelegate other) throws RemoteException { + return other.getId().equals(getId()); + } + + @Override + public int hashCodeRemote() throws RemoteException { + return id.hashCode(); + } +} diff --git a/src/com/google/android/gms/maps/model/internal/PolylineImpl.java b/src/com/google/android/gms/maps/model/internal/PolylineImpl.java index 98b41291..3ed9ad64 100644 --- a/src/com/google/android/gms/maps/model/internal/PolylineImpl.java +++ b/src/com/google/android/gms/maps/model/internal/PolylineImpl.java @@ -111,10 +111,7 @@ public class PolylineImpl extends IPolylineDelegate.Stub { @Override public boolean equalsRemote(IPolylineDelegate other) throws RemoteException { - if (other.getId().equals(getId())) { - return true; - } - return false; + return other.getId().equals(getId()); } @Override diff --git a/src/com/google/android/location/internal/GoogleLocationManagerService.java b/src/com/google/android/location/internal/GoogleLocationManagerService.java index 6d58f1a1..b402fa7b 100644 --- a/src/com/google/android/location/internal/GoogleLocationManagerService.java +++ b/src/com/google/android/location/internal/GoogleLocationManagerService.java @@ -18,15 +18,30 @@ package com.google.android.location.internal; import android.app.Service; import android.content.Intent; +import android.os.Bundle; import android.os.IBinder; +import android.os.RemoteException; +import android.util.Log; import com.google.android.gms.common.internal.AbstractGmsServiceBroker; +import com.google.android.gms.common.internal.IGmsCallbacks; public class GoogleLocationManagerService extends Service { - @Override - public IBinder onBind(Intent intent) { - return new Broker().asBinder(); - } + private static final String TAG = GoogleLocationManagerService.class.getName(); - private class Broker extends AbstractGmsServiceBroker { - } + @Override + public IBinder onBind(Intent intent) { + return new Broker(intent).asBinder(); + } + + private class Broker extends AbstractGmsServiceBroker { + public Broker(Intent intent) { + Log.d(TAG, "Incoming intent: " + intent.toString()); + } + + @Override + public void getGoogleLocationManagerService(IGmsCallbacks callback, int code, String str, Bundle params) throws RemoteException { + Log.d(TAG, "getGoogleLocationManagerService: " + code + ", " + str + ", " + params); + callback.onPostInitComplete(code, null, params); + } + } }