New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Team decided to do a breaking change in getErrorReport #306
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.microsoft.azure.mobile.analytics.mobile.sasquatch.features; | ||
|
||
import android.util.Log; | ||
|
||
import com.microsoft.azure.mobile.crashes.Crashes; | ||
import com.microsoft.azure.mobile.crashes.model.ErrorReport; | ||
|
||
import static com.microsoft.azure.mobile.sasquatch.activities.MainActivity.LOG_TAG; | ||
|
||
public class GetLastSessionErrorReportFeatureTest { | ||
|
||
public static void run() { | ||
ErrorReport lastSessionCrashReport = Crashes.getLastSessionCrashReport(); | ||
if (lastSessionCrashReport != null) { | ||
Log.i(LOG_TAG, "Crashes.getLastSessionCrashReport().getThrowable()=", lastSessionCrashReport.getThrowable()); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.microsoft.azure.mobile.analytics.mobile.sasquatch.features; | ||
|
||
import android.support.annotation.Nullable; | ||
import android.util.Log; | ||
|
||
import com.microsoft.azure.mobile.ResultCallback; | ||
import com.microsoft.azure.mobile.crashes.Crashes; | ||
import com.microsoft.azure.mobile.crashes.model.ErrorReport; | ||
|
||
import static com.microsoft.azure.mobile.sasquatch.activities.MainActivity.LOG_TAG; | ||
|
||
public class GetLastSessionErrorReportFeatureTest { | ||
|
||
public static void run() { | ||
Crashes.getLastSessionCrashReport(new ResultCallback<ErrorReport>() { | ||
|
||
@Override | ||
public void onResult(@Nullable ErrorReport data) { | ||
if (data != null) { | ||
Log.i(LOG_TAG, "Crashes.getLastSessionCrashReport().getThrowable()=", data.getThrowable()); | ||
} | ||
} | ||
}); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,14 +263,14 @@ public static boolean hasCrashedInLastSession() { | |
/** | ||
* Provides information about any available crash report from the last session, if it crashed. | ||
* This method is a synchronous call and blocks caller thread. | ||
* Use {@link #getLastSessionCrashReportAsync(ResultCallback)} for asynchronous call. | ||
* Use {@link #getLastSessionCrashReport(ResultCallback)} for asynchronous call. | ||
* | ||
* @return The crash report from the last session if one was set. | ||
* @see #getLastSessionCrashReportAsync(ResultCallback) | ||
* @see #getLastSessionCrashReport(ResultCallback) | ||
*/ | ||
@Nullable | ||
@WorkerThread | ||
public static ErrorReport getLastSessionCrashReport() { | ||
static ErrorReport getLastSessionCrashReport() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of this, can you call There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe not because it is private? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to check something before I can answer that. |
||
return getInstance().getInstanceLastSessionCrashReport(); | ||
} | ||
|
||
|
@@ -279,8 +279,8 @@ public static ErrorReport getLastSessionCrashReport() { | |
* | ||
* @param callback The callback that will receive crash in the last session. | ||
*/ | ||
public static void getLastSessionCrashReportAsync(ResultCallback<ErrorReport> callback) { | ||
getInstance().getInstanceLastSessionCrashReportAsync(callback); | ||
public static void getLastSessionCrashReport(ResultCallback<ErrorReport> callback) { | ||
getInstance().getInstanceLastSessionCrashReport(callback); | ||
} | ||
|
||
/** | ||
|
@@ -306,9 +306,9 @@ private synchronized ErrorReport getInstanceLastSessionCrashReport() { | |
} | ||
|
||
/** | ||
* Implements {@link #getLastSessionCrashReportAsync(ResultCallback)} at instance level. | ||
* Implements {@link #getLastSessionCrashReport(ResultCallback)} at instance level. | ||
*/ | ||
private synchronized void getInstanceLastSessionCrashReportAsync(final ResultCallback<ErrorReport> callback) { | ||
private synchronized void getInstanceLastSessionCrashReport(final ResultCallback<ErrorReport> callback) { | ||
if (mCountDownLatch == null || mCountDownLatch.getCount() <= 0) | ||
HandlerUtils.runOnUiThread(new Runnable() { | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really want to have
Test
at the end of the class name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's a feature test, the one for get last session error report. So it's a get last session error report feature test.