From e841daa61510cc3c11837903b3d22761cf6bc42e Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Sat, 31 Mar 2012 12:27:01 -0400 Subject: [PATCH] Updated build paths to be ADt 17 compliant and fixed lint errors Change-Id: I8b89e983d71bed87c70cf5e977c8a3445fbd51d6 Signed-off-by: Ricky Barrette --- ExceptionHandlerLib/.classpath | 1 + ExceptionHandlerLib/proguard.cfg | 6 ++-- ExceptionHandlerLib/project.properties | 2 +- .../res/layout/exception_list_item.xml | 4 +-- .../TwentyCodes/android/exception/Report.java | 4 +-- .../exception/ReportPostingService.java | 29 +++++++++++-------- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ExceptionHandlerLib/.classpath b/ExceptionHandlerLib/.classpath index 6c635c0..a4763d1 100644 --- a/ExceptionHandlerLib/.classpath +++ b/ExceptionHandlerLib/.classpath @@ -3,5 +3,6 @@ + diff --git a/ExceptionHandlerLib/proguard.cfg b/ExceptionHandlerLib/proguard.cfg index 8ad7d33..c6bb909 100644 --- a/ExceptionHandlerLib/proguard.cfg +++ b/ExceptionHandlerLib/proguard.cfg @@ -12,15 +12,15 @@ -keep public class * extends android.content.ContentProvider -keep public class com.android.vending.licensing.ILicensingService --keepclasseswithmembernames class * { +--keepclasseswithmembers class * { native ; } --keepclasseswithmembernames class * { +--keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet); } --keepclasseswithmembernames class * { +--keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet, int); } diff --git a/ExceptionHandlerLib/project.properties b/ExceptionHandlerLib/project.properties index 5ca7d62..f28bc83 100644 --- a/ExceptionHandlerLib/project.properties +++ b/ExceptionHandlerLib/project.properties @@ -9,4 +9,4 @@ android.library=true # Project target. -target=android-14 +target=android-15 diff --git a/ExceptionHandlerLib/res/layout/exception_list_item.xml b/ExceptionHandlerLib/res/layout/exception_list_item.xml index 65238cc..4b56d94 100644 --- a/ExceptionHandlerLib/res/layout/exception_list_item.xml +++ b/ExceptionHandlerLib/res/layout/exception_list_item.xml @@ -6,8 +6,8 @@ android:orientation="vertical" android:background="#ffffff"> + + mReport; @@ -65,7 +63,7 @@ public class Report implements Parcelable{ * @author ricky barrette */ public Report(String url) { - Log.d(TAG, url); +// Log.d(TAG, url); this.mUrl = url; } diff --git a/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java b/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java index 5a53dca..da3bfd5 100644 --- a/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java +++ b/ExceptionHandlerLib/src/com/TwentyCodes/android/exception/ReportPostingService.java @@ -31,6 +31,7 @@ public class ReportPostingService extends Service { private static final String TAG = "ReportPostingService"; private int mStartId; private Report mReport; + private boolean isStarted; /** * Extracts the report object from the intent @@ -113,18 +114,22 @@ public class ReportPostingService extends Service { * @author ricky barrette */ private void postReport(){ - new Thread(new Runnable() { - @Override - public void run(){ - try { - Log.d(TAG, mReport.file()); - } catch (ClientProtocolException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); + if(!isStarted){ + isStarted = true; + new Thread(new Runnable() { + @Override + public void run(){ + try { + Log.d(TAG, mReport.file()); + } catch (ClientProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + ReportPostingService.this.stopSelf(mStartId); + } } - ReportPostingService.this.stopSelf(mStartId); - } - }).start(); + }).start(); + } } }