altosdroid: Restore google maps key setting
authorKeith Packard <keithp@keithp.com>
Sun, 7 Oct 2018 06:32:24 +0000 (23:32 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 7 Oct 2018 06:32:24 +0000 (23:32 -0700)
Only for altosdroid, and use a key restricted to our app

Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/AndroidManifest.xml.in
configure.ac

index 43a0787..3f17188 100644 (file)
                  
         <service android:name=".TelemetryService" />
 
+        <meta-data android:name="com.google.android.maps.v2.API_KEY"
+                   android:value="@GOOGLEKEY@"/>
         <meta-data android:name="com.google.android.gms.version"
                    android:value="@integer/google_play_services_version" />
     </application>
index 741fa01..dae2499 100644 (file)
@@ -172,12 +172,26 @@ AM_CONDITIONAL(FATINSTALL, [test "x$FATDIR" != "xnone"])
 
 AC_SUBST(FATDIR)
 
+AC_ARG_WITH(google-key, AS_HELP_STRING([--with-google-key=PATH],
+           [Set the file to read the AltosDroid maps API key from (defaults to ~/altusmetrumllc/google-altosdroid-maps-api-key)]),
+           [GOOGLEKEYFILE=$withval], [GOOGLEKEYFILE=$HOME/altusmetrumllc/google-altosdroid-maps-api-key])
+
+if test -r "$GOOGLEKEYFILE" -a -s "$GOOGLEKEYFILE"; then
+       GOOGLEKEY=`cat "$GOOGLEKEYFILE"`
+       HAVE_GOOGLE_KEY="yes"
+else
+       GOOGLEKEY='null'
+       HAVE_GOOGLE_KEY="no"
+fi
+
 AC_ARG_ENABLE(faketime, AS_HELP_STRING([--enable-faketime],
               [Use faketime program to ensure pdf files are reproducible (default=no)]),
              [FAKETIME=$enableval], [FAKETIME=no])
 
 AM_CONDITIONAL(FAKETIME, [test x$FAKETIME = xyes])
 
+AC_SUBST(GOOGLEKEY)
+
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_LN_S
@@ -586,7 +600,7 @@ echo "    freetts.....................: ${FREETTS}"
 echo "    jfreechart..................: ${JFREECHART}"
 echo "    jcommon.....................: ${JCOMMON}"
 echo "    JVM include.................: ${JVM_INCLUDE}"
-echo "    Google maps API key.........: ${HAVE_GOOGLE_KEY}"
+echo "    AltosDroid maps API key.....: ${HAVE_GOOGLE_KEY}"
 if test x${ANDROID_SDK} != "xno"; then
 echo ""
 echo "  Android path"