Skip to content

Commit ae58234

Browse files
committed
Minor Android lints
1 parent dfc82cb commit ae58234

File tree

4 files changed

+23
-9
lines changed

4 files changed

+23
-9
lines changed

OpacityCore/src/main/cpp/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ add_library(opacity_core STATIC IMPORTED)
88
set_target_properties(opacity_core PROPERTIES IMPORTED_LOCATION ${OPACITY_CORE_LIB})
99

1010
add_library(${CMAKE_PROJECT_NAME} SHARED
11-
# List C/C++ source files with relative paths to this CMakeLists.txt.
1211
OpacityCore.cpp)
1312

1413
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/../jni/include)

OpacityCore/src/main/kotlin/com/opacitylabs/opacitycore/OpacityCore.kt

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@ import android.os.Bundle
66
import androidx.localbroadcastmanager.content.LocalBroadcastManager
77
import kotlinx.coroutines.Dispatchers
88
import kotlinx.coroutines.withContext
9-
import kotlinx.serialization.*
10-
import kotlinx.serialization.json.*
9+
import kotlinx.serialization.encodeToString
10+
import kotlinx.serialization.json.Json
11+
import kotlinx.serialization.json.JsonArray
12+
import kotlinx.serialization.json.JsonElement
13+
import kotlinx.serialization.json.JsonObject
14+
import kotlinx.serialization.json.JsonPrimitive
15+
import kotlinx.serialization.json.boolean
16+
import kotlinx.serialization.json.booleanOrNull
17+
import kotlinx.serialization.json.double
18+
import kotlinx.serialization.json.doubleOrNull
19+
import kotlinx.serialization.json.int
20+
import kotlinx.serialization.json.intOrNull
21+
import kotlinx.serialization.json.jsonObject
1122
import org.mozilla.geckoview.GeckoRuntime
1223

1324
object OpacityCore {
@@ -67,8 +78,8 @@ object OpacityCore {
6778
fun presentBrowser() {
6879
val intent = Intent()
6980
intent.setClassName(
70-
appContext.packageName,
71-
"com.opacitylabs.opacitycore.InAppBrowserActivity"
81+
appContext.packageName,
82+
"com.opacitylabs.opacitycore.InAppBrowserActivity"
7283
)
7384
intent.putExtra("url", _url)
7485
intent.putExtra("headers", headers)
@@ -91,12 +102,15 @@ object OpacityCore {
91102
else -> throw Exception("Could not convert JSON primitive $jsonElement")
92103
}
93104
}
105+
94106
is JsonObject -> {
95107
jsonElement.toMap().mapValues { parseJsonElementToAny(it.value) }
96108
}
109+
97110
is JsonArray -> {
98111
jsonElement.map { parseJsonElementToAny(it) }
99112
}
113+
100114
else -> throw Exception("Could not convert JSON primitive $jsonElement")
101115
}
102116
}
@@ -111,9 +125,9 @@ object OpacityCore {
111125
}
112126

113127
val map: Map<String, Any> =
114-
Json.parseToJsonElement(res.data!!).jsonObject.mapValues {
115-
parseJsonElementToAny(it.value)
116-
}
128+
Json.parseToJsonElement(res.data!!).jsonObject.mapValues {
129+
parseJsonElementToAny(it.value)
130+
}
117131
map
118132
}
119133
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
77
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
88
<uses-permission android:name="android.permission.CAMERA" />
9+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
910

1011
<uses-feature android:name="android.hardware.camera" />
1112
<application

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9-
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
9+
org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
1010
# When configured, Gradle will run in incubating parallel mode.
1111
# This option should only be used with decoupled projects. For more details, visit
1212
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects

0 commit comments

Comments
 (0)