Skip to content

Commit d301ba3

Browse files
committed
Rename openDuckChatIntent to createDuckChatIntent for clarity and update references accordingly.
1 parent 356568e commit d301ba3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

app/src/main/java/com/duckduckgo/widget/SearchWidgetConfigurator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class SearchWidgetConfigurator @Inject constructor(
7575
private fun buildDuckAiPendingIntent(
7676
context: Context,
7777
): PendingIntent? {
78-
val intent = duckChat.openDuckChatIntent()
78+
val intent = duckChat.createDuckChatIntent()
7979
if (intent == null) {
8080
return null
8181
}

duckchat/duckchat-api/src/main/java/com/duckduckgo/duckchat/api/DuckChat.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ interface DuckChat {
3737
fun openDuckChat()
3838

3939
/**
40-
* Opens the DuckChat WebView with an intent.
40+
* Creates an Intent that can be used to launch the DuckChat WebView.
41+
* Does not actually open DuckChat, just prepares the Intent.
4142
*
42-
* @return Intent to open DuckChat.
43+
* @return Intent that can be used to open DuckChat, or null if DuckChat cannot be opened.
4344
*/
44-
fun openDuckChatIntent(): Intent?
45+
fun createDuckChatIntent(): Intent?
4546

4647
/**
4748
* Auto-prompts the DuckChat WebView with the provided [String] query.

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/RealDuckChat.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ class RealDuckChat @Inject constructor(
386386
openDuckChat(emptyMap())
387387
}
388388

389-
override fun openDuckChatIntent(): Intent? {
390-
logcat { "Duck.ai: openDuckChatIntent" }
389+
override fun createDuckChatIntent(): Intent? {
390+
logcat { "Duck.ai: createDuckChatIntent" }
391391
val parameters = addChatParameters("", autoPrompt = false)
392392
val url = appendParameters(parameters, duckChatLink)
393393

0 commit comments

Comments
 (0)