Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.6.21'
ext.safeargs_version = '2.3.0'
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
repositories {
google()
jcenter()

mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$safeargs_version"
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.4.0")

// TODO AC-861
//classpath 'com.dicedmelon.gradle:jacoco-android:0.1.4'
Expand All @@ -27,7 +26,9 @@ buildscript {
allprojects {
repositories {
google()
jcenter()

mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://maven.aliyun.com/repository/jcenter" }
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ org.gradle.jvmargs=-Xmx4608m
# org.gradle.parallel=true

android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
org.gradle.java.home=/usr/lib/jvm/java-1.11.0-openjdk-amd64
18 changes: 5 additions & 13 deletions openmrs-android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven-publish'
id 'org.jetbrains.dokka'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
Expand All @@ -13,7 +12,7 @@ android {

defaultConfig {
minSdkVersion 17
targetSdkVersion 29
targetSdkVersion 34
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -51,11 +50,11 @@ android {
implementation 'com.google.code.gson:gson:2.8.5'

// room
implementation 'androidx.room:room-runtime:2.3.0-alpha01'
implementation 'android.arch.persistence.room:rxjava2:1.1.1'
implementation 'androidx.room:room-runtime:2.4.3'
implementation 'androidx.room:room-rxjava2:2.4.3'

//no inspection
kapt 'androidx.room:room-compiler:2.1.0-alpha04'
kapt 'androidx.room:room-compiler:2.4.3'

// joda time
implementation 'joda-time:joda-time:2.10.6'
Expand All @@ -77,7 +76,7 @@ android {
implementation "com.google.code.gson:gson:2.8.5"

// Work Manager
implementation "androidx.work:work-runtime:2.3.4"
implementation "androidx.work:work-runtime:2.7.1"

// test implementation
testImplementation 'junit:junit:4.+'
Expand Down Expand Up @@ -135,10 +134,3 @@ android {
}
}

dokkaHtml.configure {
dokkaSourceSets {
named("main") {
noAndroidSdkLink.set(false)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ object ApplicationConstants {
const val VISIT_TYPE_UUID = "visit_type_uuid"
const val LAST_SESSION_TOKEN = "last_session_id"
const val LAST_LOGIN_SERVER_URL = "last_login_server_url"
const val DEFAULT_OPEN_MRS_URL = "https://demo.openmrs.org/openmrs"
const val DEFAULT_OPEN_MRS_URL = "https://portal-qa.medihealthng.com/medihealth"
const val DB_NAME = "openmrs.db"
const val DB_PASSWORD_BCRYPT_PEPPER = "$2a$08\$iUp3M1VapYpjcAXQBNX6uu"
const val DB_PASSWORD_LITERAL_PEPPER = "Open Sesame"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ object ToastUtil {
}
logger.d("Decode bitmap: $bitmap")
val toast = Toast(context)
toast.view = toastRoot
toast.duration = duration
toast.setView(toastRoot)
toast.setDuration(duration)
toast.show()
val thread = ToastThread(duration)
if (toastQueue.size == 0) {
Expand Down
4 changes: 2 additions & 2 deletions openmrs-android-sdk/versions.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ext.versions = [:]

versions.compileSdk = 29
versions.compileSdk = 31
versions.minSdk = 19
versions.targetSdk = 29
versions.targetSdk = 34
versions.appVersion = "2.9.0"

// Libraries
Expand Down
3 changes: 1 addition & 2 deletions openmrs-client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ dependencies {

// Database components
implementation "androidx.room:room-runtime:${versions.roomRuntime}"
implementation "android.arch.persistence.room:rxjava2:${versions.roomPersistence}"
implementation "androidx.room:room-rxjava2:${versions.roomPersistence}"

// Noinspection GradleDependency
annotationProcessor "androidx.room:room-compiler:${versions.roomCompiler}"
Expand Down Expand Up @@ -231,7 +231,6 @@ dependencies {
kaptTest "com.google.dagger:hilt-compiler:${versions.hilt}"

// Leak Canary
debugImplementation "com.squareup.leakcanary:leakcanary-android:${versions.leakcanary}"
// Debug database
debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
}
Expand Down
12 changes: 10 additions & 2 deletions openmrs-client/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

<uses-feature
android:name="android.hardware.camera"
Expand All @@ -43,7 +45,8 @@
<activity
android:name=".activities.introduction.SplashActivity"
android:noHistory="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -63,7 +66,9 @@
</intent-filter>
</receiver>

<service android:name=".services.ConceptDownloadService" />
<service
android:name=".services.ConceptDownloadService"
android:foregroundServiceType="dataSync" />

<activity
android:name=".activities.dashboard.DashboardActivity"
Expand All @@ -77,6 +82,7 @@
android:name=".activities.syncedpatients.SyncedPatientsActivity"
android:configChanges="keyboardHidden|screenSize"
android:label="@string/action_synced_patients"
android:exported="false"
android:launchMode="singleTop"
android:theme="@style/AppThemeOrig">

Expand Down Expand Up @@ -120,6 +126,7 @@
android:name=".activities.activevisits.ActiveVisitsActivity"
android:configChanges="keyboardHidden|screenSize"
android:label="@string/action_active_visits"
android:exported="false"
android:launchMode="singleTop"
android:theme="@style/AppThemeOrig">

Expand Down Expand Up @@ -215,6 +222,7 @@
android:name=".activities.lastviewedpatients.LastViewedPatientsActivity"
android:configChanges="keyboardHidden|screenSize"
android:label="@string/action_download_patients"
android:exported="false"
android:launchMode="singleTop"
android:theme="@style/AppThemeOrig">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ protected void onResume() {
&& !(this instanceof ContactUsActivity) && !(this instanceof SplashActivity)) {
mAuthorizationManager.moveToLoginActivity();
}
registerReceiver(mPasswordChangedReceiver, mIntentFilter);
if (android.os.Build.VERSION.SDK_INT >= 33) {
registerReceiver(mPasswordChangedReceiver, mIntentFilter, 4 /* RECEIVER_NOT_EXPORTED */);
} else {
registerReceiver(mPasswordChangedReceiver, mIntentFilter);
}
ToastUtil.setAppVisible(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class OpenMRS extends MultiDexApplication implements Configuration.Provid
public static OpenMRS getInstance() {
return instance;
}

@Override
public void onCreate() {
super.onCreate();
Expand All @@ -56,10 +55,20 @@ public void onCreate() {
if (mExternalDirectoryPath == null) {
mExternalDirectoryPath = this.getExternalFilesDir(null).toString();
}
Intent i = new Intent(this, FormListService.class);
startService(i);
Intent intent = new Intent(this, AuthenticateCheckService.class);
startService(intent);

try {
Intent i = new Intent(this, FormListService.class);
startService(i);
} catch (Exception e) {
e.printStackTrace();
}

try {
Intent intent = new Intent(this, AuthenticateCheckService.class);
startService(intent);
} catch (Exception e) {
e.printStackTrace();
}
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void showNotification(int downloadedConcepts) {
Intent notificationIntent = new Intent(this, SettingsActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
notificationIntent.putExtra(ApplicationConstants.BroadcastActions.CONCEPT_DOWNLOAD_BROADCAST_INTENT_KEY_COUNT, downloadedConcepts);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE);

Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_openmrs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected void onHandleIntent(Intent intent) {
formResourceDAO.addFormResource(formResourceEntity);
}
} catch (Exception e) {
ToastUtil.error(response.message());
ToastUtil.error(response != null ? response.message() : e.getMessage());
}
// Refresh encounter types
EncounterTypeRoomDAO encounterTypeRoomDAO = appDatabase.encounterTypeRoomDAO();
Expand All @@ -68,7 +68,7 @@ protected void onHandleIntent(Intent intent) {
encounterTypeRoomDAO.addEncounterType(encounterType);
}
} catch (Exception e) {
ToastUtil.error(response2.message());
ToastUtil.error(response2 != null ? response2.message() : e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class ForceClose @Inject constructor(private val context: Context) : Thread.Unca
val i = context.packageManager.getLaunchIntentForPackage("org.openmrs.mobile")
i?.putExtra("flag", true)
i?.putExtra("error", errorReport.toString())
i?.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(i)
Process.killProcess(Process.myPid())
exitProcess(10)
Expand Down
Binary file modified openmrs-client/src/main/res/drawable-hdpi/ic_openmrs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-hdpi/openmrs_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-mdpi/ic_openmrs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-mdpi/openmrs_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-xhdpi/ic_openmrs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-xhdpi/openmrs_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-xxhdpi/ic_openmrs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-xxhdpi/openmrs_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-xxxhdpi/ic_openmrs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified openmrs-client/src/main/res/drawable-xxxhdpi/openmrs_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions openmrs-client/src/main/res/layout/fragment_login.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/loginUsernameField"
android:text="admin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
Expand All @@ -158,6 +159,7 @@

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/loginPasswordField"
android:text="Admin123"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
Expand Down
10 changes: 5 additions & 5 deletions openmrs-client/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
-->

<resources>
<string name="app_name">OpenMRS Android Client</string>
<string name="organization_name" translatable="false">OpenMRS</string>
<string name="app_name">MediHealth</string>
<string name="organization_name" translatable="false">MediHealth</string>
<string name="client_name" translatable="false">Client</string>
<string name="action_settings">Settings</string>
<string name="action_logout">Logout</string>
Expand Down Expand Up @@ -79,7 +79,7 @@

<!-- Logout dialog -->
<string name="logout_dialog_title">Logging out</string>
<string name="logout_dialog_message">Are you sure you want to logout from OpenMRS client?</string>
<string name="logout_dialog_message">Are you sure you want to logout from MediHealth client?</string>
<string name="logout_dialog_button">Logout</string>
<!--Credentials Changed dialog-->
<string name="credentials_changed_dialog_title">Credentials changed</string>
Expand Down Expand Up @@ -182,7 +182,7 @@
<string name="search_visits_no_results">No active visits in database</string>

<!-- ACBase activity -->
<string name="error_email_subject_app_crashed">OpenMRS android client crashed</string>
<string name="error_email_subject_app_crashed">MediHealth android client crashed</string>
<string name="choose_a_email_client">Choose an Email client :</string>
<string name="no_internet_connection_message">No internet connection</string>

Expand Down Expand Up @@ -256,7 +256,7 @@
<string name="charts_view_toolbar_title">Charts View</string>

<!-- Image content description strings -->
<string name="openmrs_logo">OpenMRS logo</string>
<string name="openmrs_logo">MediHealth logo</string>
<string name="toast_with_black_background">Toast with black background</string>
<string name="edit_form">Edit form</string>
<string name="patient_photo">Patient Photo</string>
Expand Down
18 changes: 9 additions & 9 deletions openmrs-client/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ext.versions = [:]

versions.compileSdk = 31
versions.minSdk = 19
versions.targetSdk = 29
versions.targetSdk = 34
versions.appVersion = "3.1.1"

// Libraries
Expand All @@ -11,8 +11,8 @@ versions.guava = '29.0-android'
versions.supportVersion = '1.0.0'
versions.recyclerView = '1.2.0-alpha03'
versions.constraintlayout = '1.1.3'
versions.fragment = "1.3.0"
versions.activity = "1.2.0"
versions.fragment = "1.5.1"
versions.activity = "1.5.1"

versions.retrofit = '2.3.0'
versions.retrofitConverter = '2.1.0'
Expand All @@ -22,13 +22,13 @@ versions.rxjava = '2.2.6'
versions.rxandroid = '2.1.1'
versions.rxbinding = '1.0.0'

versions.roomRuntime = '2.3.0-alpha01'
versions.roomPersistence = '1.1.1'
versions.roomCompiler = '2.1.0-alpha04'
versions.roomRuntime = '2.4.3'
versions.roomPersistence = '2.4.3'
versions.roomCompiler = '2.4.3'

versions.chuckerLibrary = '3.4.0'

versions.workManager = '2.3.4'
versions.workManager = '2.7.1'

versions.seekbar = '1.0.1'
versions.MPAndroidChart = 'v3.1.0'
Expand All @@ -53,7 +53,7 @@ versions.navui = '2.3.0'

versions.coreTesting = '1.1.1'

versions.hilt = '2.36'
versions.hilt = '2.44'

versions.lifecycle_version = "2.1.0"
versions.lifecycle_version = "2.5.1"
versions.arch_version = "2.1.0"
Loading