Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ooni/probe-android into issues/25…
Browse files Browse the repository at this point in the history
…24-release-3.8.4
  • Loading branch information
aanorbel committed Oct 18, 2023
2 parents 904b67c + 1457054 commit dcdc5d7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
Expand Down Expand Up @@ -175,7 +175,7 @@
<service
android:name=".common.service.RunTestService"
android:icon="@drawable/notification_icon"
android:foregroundServiceType="specialUse"
android:foregroundServiceType="dataSync"
android:label="@string/Dashboard_Card_Run"/>
<service
android:name=".common.service.RunTestJobService"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
import org.openobservatory.ooniprobe.databinding.ItemFailedBinding;
import org.openobservatory.ooniprobe.model.database.Result;

import java.util.Date;
import java.util.Locale;
import static java.util.concurrent.TimeUnit.*;

import localhost.toolkit.widget.recyclerview.HeterogeneousRecyclerItem;

Expand All @@ -39,8 +41,19 @@ public FailedItem(Result extra, View.OnClickListener onClickListener, View.OnLon
viewHolder.binding.icon.setImageResource(extra.getTestSuite().getIcon());
viewHolder.binding.testName.setText(extra.getTestSuite().getTitle());
String failure_msg = viewHolder.itemView.getContext().getString(R.string.TestResults_Overview_Error);
if (extra.failure_msg != null)
if (extra.failure_msg != null) {
failure_msg += " - " + extra.failure_msg;
} else {
// NOTE: If the test is running for more than 5 minutes, we assume it's stuck or failed,
// and we show the default error message.
long MAX_DURATION = MILLISECONDS.convert(5, MINUTES);
long duration = new Date().getTime() - extra.start_time.getTime();
if (duration < MAX_DURATION) {
failure_msg = viewHolder.itemView.getContext()
.getString(R.string.Dashboard_Running_Running)
.replace(":","");
}
}
viewHolder.binding.subtitle.setText(failure_msg);
viewHolder.binding.startTime.setText(DateFormat.format(DateFormat.getBestDateTimePattern(Locale.getDefault(), "yMdHm"), extra.start_time));
}
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
androidGradlePlugin = "7.4.1"
barista = "3.9.0"
countlySdk = "21.11.0"
countlySdk = "23.6.0"
faker = "1.2.8"
mockitoCore = "5.3.1"
mockitoInline = "4.6.1"
Expand All @@ -11,7 +11,7 @@ sentryAndroid = "6.3.0"
xanscaleLocalhostToolkit = "19.05.01"
commonsIo = "2.6"
jacoco = "0.8.5"
kotlin = "1.6.21"
kotlin = "1.8.0"

# Android X
androidxCore = "1.5.0"
Expand All @@ -38,7 +38,7 @@ compileSdk = "34"
lottie = "3.0.7"
markwon = "2.0.1"
shapeofview = "1.3.2"
targetSdk = "34"
targetSdk = "33"
minSdk = "21"
oonimkall = "2023.10.12-183140"

Expand Down

0 comments on commit dcdc5d7

Please sign in to comment.