Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
avazirna committed Oct 3, 2023
2 parents edfce31 + 88185fd commit 65cc28e
Show file tree
Hide file tree
Showing 53 changed files with 742 additions and 539 deletions.
20 changes: 15 additions & 5 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,27 @@
android:name="android.permission.INTERNET"/>
<uses-permission
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<!-- required to ensure app compatibility -->
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"
android:usesPermissionFlags="neverForLocation"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-feature
android:name="android.hardware.telephony"
Expand Down Expand Up @@ -105,7 +114,8 @@
android:label="@string/application_name"
android:hardwareAccelerated="true"
android:usesCleartextTraffic="true"
android:theme="@style/AppBaseTheme">
android:theme="@style/AppBaseTheme"
android:enableOnBackInvokedCallback="false">

<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
Expand All @@ -121,7 +131,7 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="${applicationId}.action.CommCareSession"/>
<action android:name="org.commcare.dalvik.action.CommCareSession"/>

<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
Expand Down
6 changes: 5 additions & 1 deletion app/assets/locales/android_translatable_strings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ mult.install.bad=The selected ZIP file is not valid. Please choose a valid zip f
mult.install.progress.baddest=Couldn't write multimedia to the local filesystem at: ${0}
mult.install.progress.badentry=There was a bad entry in the zip file: ${0}
mult.install.progress.errormoving=There was a problem copying the multimedia from the zip file, please try again.
mult.install.progress.invalid.ccz=The selected CCZ file is invalid, please verify it and try again!

mult.install.prompt=From here you can install your app multimedia from a ZIP file on the local filesystem
mult.install.button=Install Multimedia
Expand Down Expand Up @@ -814,6 +815,9 @@ wifi.direct.status.receive.message=This will allow you to receive forms on this
wifi.direct.status.submit.header=You are in Submit Form Mode
wifi.direct.status.submit.count=Device has ${0} unsubmitted forms.
wifi.direct.status.submit.message=This mode will allow you to submit forms to the CommCare Server if you have an internet connection.
wifi.direct.permission.nearby.wifi.title=Permission to access nearby Wi-Fi Devices
wifi.direct.permission.nearby.wifi.message=In order to exchange data with nearby devices via Wi-Fi, CommCare needs access to Wi-Fi capabilities.
wifi.direct.permission.nearby.wifi.denial=CommCare doesn't have permission to connect with nearby devices via Wi-Fi. Please enable via Android's settings.

form.transfer.no.forms=No forms to send.

Expand All @@ -834,7 +838,7 @@ odk_perfect_match_color=\#87D13E
odk_fuzzy_match_color=\#FFE88F

permission.all.title=CommCare Permissions
permission.all.message=CommCare needs permissions to read/write forms to memory, call/message from the case list, and provide location data during form entry.
permission.all.message=CommCare needs permissions to read/write forms to memory, call/message from the case list, provide location data during form entry and notify the user about important events.
permission.all.denial.message=CommCare doesn't have the necessary permissions. Please enable via Android's settings.
permission.case.callout.title=Permissions for calling & messaging
permission.case.callout.message=CommCare needs call & messaging permissions to enable communication with cases.
Expand Down
41 changes: 5 additions & 36 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ dependencies {
implementation 'org.jsoup:jsoup:1.15.3'
implementation 'com.scottyab:rootbeer-lib:0.1.0'

// crashes on update - https://developers.google.com/admob/android/quick-start#update_your_androidmanifestxml
// We need to update consumer apps script to inject the right admob id to be able to update this
implementation 'com.google.firebase:firebase-ads:16.0.1'

implementation 'com.carrotsearch:hppc:0.9.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
Expand All @@ -104,7 +100,7 @@ dependencies {
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'com.duolingo.open:rtl-viewpager:2.0.0'
implementation ("com.github.bumptech.glide:glide:4.9.0") {
implementation("com.github.bumptech.glide:glide:4.9.0") {
exclude group: "com.android.support"
}

Expand All @@ -116,7 +112,7 @@ dependencies {
implementation "io.noties.markwon:ext-tables:$markwon_version"
implementation "io.noties.markwon:ext-strikethrough:$markwon_version"

implementation ('io.ona.kujaku:library:0.9.0'){
implementation('io.ona.kujaku:library:0.9.0') {
exclude module: 'xpp3'
}
implementation "androidx.work:work-runtime:2.7.1"
Expand All @@ -125,8 +121,6 @@ dependencies {
implementation 'com.google.android.play:core:1.10.3'
implementation 'android.arch.lifecycle:common-java8:1.1.1'

//Robust TLS 1.2 ciphers on Android 9-19
implementation "org.conscrypt:conscrypt-android:2.4.0"
implementation('com.squareup.okhttp3:okhttp-tls:3.12.12') {
exclude(group: 'org.bouncycastle', module: 'bcprov-jdk15on')
}
Expand Down Expand Up @@ -194,19 +188,6 @@ def runDownloadScripts = project.hasProperty('run_download_scripts') ? run_downl
def ccDomainSafe = ccDomain.replaceAll("-", "")
def consumerAppUsername = getConsumerAppUsername(isConsumerApp)
def consumerAppPassword = getConsumerAppPassword(isConsumerApp)
def usingAdmob = isConsumerApp && project.hasProperty('admob_id') && allAdUnitIdsPresent()
def admobId = usingAdmob ? admob_id : ""
def entityDetailAdUnitId = usingAdmob ? entity_detail_ad_id : ""
def entitySelectAdUnitId = usingAdmob ? entity_select_ad_id : ""
def menuListAdUnitId = usingAdmob ? menu_list_ad_id : ""
def menuGridAdUnitId = usingAdmob ? menu_grid_ad_id : ""

def allAdUnitIdsPresent() {
return (project.hasProperty("entity_detail_ad_id") &&
project.hasProperty("entity_select_ad_id") &&
project.hasProperty("menu_list_ad_id") &&
project.hasProperty("menu_grid_ad_id"))
}

/**
* Get the version code from command line param
Expand All @@ -226,7 +207,7 @@ static def getDate() {
}

android {
compileSdkVersion 31
compileSdkVersion 33

lintOptions {
abortOnError false
Expand All @@ -249,7 +230,7 @@ android {

defaultConfig {
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
multiDexEnabled true
applicationId "org.commcare.dalvik"
testNamespace "org.commcare.dalvik.test"
Expand Down Expand Up @@ -283,12 +264,6 @@ android {
buildConfigField "String", "ANALYTICS_TRACKING_ID_DEV", "\"${project.ext.ANALYTICS_TRACKING_ID_DEV}\""
buildConfigField "String", "MAPBOX_SDK_API_KEY", "\"${project.ext.MAPBOX_SDK_API_KEY}\""

buildConfigField "String", "ADMOB_ID", "\"\""
buildConfigField "String", "ENTITY_DETAIL_AD_UNIT_ID", "\"\""
buildConfigField "String", "ENTITY_SELECT_AD_UNIT_ID", "\"\""
buildConfigField "String", "MENU_LIST_AD_UNIT_ID", "\"\""
buildConfigField "String", "MENU_GRID_AD_UNIT_ID", "\"\""

buildConfigField "String", "HQ_API_USERNAME", "\"${project.ext.HQ_API_USERNAME}\""
buildConfigField "String", "HQ_API_PASSWORD", "\"${project.ext.HQ_API_PASSWORD}\""

Expand Down Expand Up @@ -396,7 +371,7 @@ android {
def applicationName = "CommCare LTS"
resValue "string", "application_name", applicationName
}

standalone {
// Builds commcare w/ ccz app packaged in the apk.
// Must be invoked from command-line w/ args pointing to app domain &
Expand All @@ -417,12 +392,6 @@ android {
// include this again so that the value get reloaded
buildConfigField "String", "CC_AUTHORITY", "\"${applicationId}\""
buildConfigField "String", "ODK_AUTHORITY", "\"${odkProviderStr}\""

buildConfigField "String", "ADMOB_ID", "\"${admobId}\""
buildConfigField "String", "ENTITY_DETAIL_AD_UNIT_ID", "\"${entityDetailAdUnitId}\""
buildConfigField "String", "ENTITY_SELECT_AD_UNIT_ID", "\"${entitySelectAdUnitId}\""
buildConfigField "String", "MENU_LIST_AD_UNIT_ID", "\"${menuListAdUnitId}\""
buildConfigField "String", "MENU_GRID_AD_UNIT_ID", "\"${menuGridAdUnitId}\""
}
}

Expand Down
35 changes: 25 additions & 10 deletions app/instrumentation-tests/src/org/commcare/androidTests/BaseTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.commcare.androidTests

import android.Manifest
import android.os.Build
import androidx.test.espresso.Espresso
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand All @@ -22,16 +23,7 @@ abstract class BaseTest {

@Rule
@JvmField
var permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.CALL_PHONE,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.CAMERA
)
var permissionRule: GrantPermissionRule = GrantPermissionRule.grant(*getAppPermissions())

protected open fun installApp(appName: String, ccz: String, force: Boolean = false) {
if (CommCareApplication.instance().currentApp == null) {
Expand All @@ -44,4 +36,27 @@ abstract class BaseTest {
Espresso.pressBack()
}
}

private fun getAppPermissions(): Array<String> {
var appPermissions = mutableListOf(
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.CALL_PHONE,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.RECORD_AUDIO,
Manifest.permission.CAMERA)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
appPermissions.addAll(arrayOf(
Manifest.permission.READ_MEDIA_IMAGES,
Manifest.permission.READ_MEDIA_AUDIO,
Manifest.permission.READ_MEDIA_VIDEO,
Manifest.permission.POST_NOTIFICATIONS))
} else {
appPermissions.addAll(arrayOf(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_EXTERNAL_STORAGE))
}
return appPermissions.toTypedArray()
}
}
Loading

0 comments on commit 65cc28e

Please sign in to comment.