forked from upstream-mirrors/OpenTracks
Merge from main repo
This commit is contained in:
@@ -127,26 +127,24 @@ limitations under the License.
|
||||
</TableLayout>
|
||||
</ScrollView>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_bar"
|
||||
android:padding="3dip">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="2dip"
|
||||
android:paddingRight="2dip"
|
||||
android:paddingTop="4dip">
|
||||
<!-- left spacer -->
|
||||
<LinearLayout style="@style/DialogButtonSpacer"/>
|
||||
<Button android:id="@+id/sendtogoogle_cancel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dip"
|
||||
android:layout_gravity="right"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/cancel"
|
||||
android:textSize="14dip"/>
|
||||
<TextView
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
style="@style/DialogButton"/>
|
||||
<Button android:id="@+id/sendtogoogle_send_now"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dip"
|
||||
android:layout_gravity="right"
|
||||
android:text="@string/sendtogoogle_send_now"
|
||||
android:textSize="14dip"/>
|
||||
style="@style/DialogButton"/>
|
||||
<!-- right spacer -->
|
||||
<LinearLayout style="@style/DialogButtonSpacer"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -85,4 +85,22 @@ limitations under the License.
|
||||
<style name="WidgetText.Register">
|
||||
<item name="android:width">160px</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the buttons on the bottom of a dialog. -->
|
||||
<style name="DialogButton">
|
||||
<item name="android:layout_height">48dip</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">0dip</item>
|
||||
<item name="android:maxLines">2</item>
|
||||
<item name="android:textSize">14dip</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the spacer on the left and right of the dialog buttons. -->
|
||||
<style name="DialogButtonSpacer">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">0.25</item>
|
||||
<item name="android:layout_width">0dip</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -153,6 +153,9 @@ public class TrackRecordingService extends Service {
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(final Location location) {
|
||||
if (executorService.isShutdown() || executorService.isTerminated()) {
|
||||
return;
|
||||
}
|
||||
executorService.submit(
|
||||
new Runnable() {
|
||||
@Override
|
||||
@@ -342,7 +345,6 @@ public class TrackRecordingService extends Service {
|
||||
timer.purge();
|
||||
unregisterLocationListener();
|
||||
shutdownTaskExecutors();
|
||||
executorService.shutdown();
|
||||
if (sensorManager != null) {
|
||||
sensorManager.shutdown();
|
||||
sensorManager = null;
|
||||
@@ -358,6 +360,8 @@ public class TrackRecordingService extends Service {
|
||||
// This should be the last operation.
|
||||
releaseWakeLock();
|
||||
|
||||
// Shutdown the executor service last to avoid sending events to a dead executor.
|
||||
executorService.shutdown();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user