Skip to content

Commit

Permalink
* Updated to snips 0.60.2
Browse files Browse the repository at this point in the history
* Removed "lazy" loading of assistant file
  • Loading branch information
thanksmister committed Oct 30, 2018
1 parent 1ea8eed commit 401a934
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ repositories {

def versionMajor = 0
def versionMinor = 1
def versionPatch = 0
def versionBuild = 4 // bump for dog food builds, public betas, etc.
def versionPatch = 1
def versionBuild = 0 // bump for dog food builds, public betas, etc.

def ALARM_CODE() {
Properties properties = new Properties()
Expand Down Expand Up @@ -135,7 +135,7 @@ dependencies {
implementation 'com.google.android.gms:play-services-vision:16.2.0'

// Snips
implementation('ai.snips:snips-platform-android:0.58.3@aar') {
implementation('ai.snips:snips-platform-android:0.60.2@aar') {
transitive = true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class SnipsModule (base: Context?, private var options: SnipsOptions, var listen
snipsClient!!.startNotification("Sorry, I didn't understand.", null)
} else if (SessionTermination.Type.TIMEOUT == sessionEndedMessage.termination.type
&& !manuallyListening && !lowProbability) {
snipsClient!!.startNotification("Sorry, I don't know how to do that.", null)
snipsClient!!.startNotification("Sorry, I may not have heard you in time.", null)
} else if (SessionTermination.Type.NOMINAL == sessionEndedMessage.termination.type) {
//snipsClient!!.startNotification("Assistant initialized and ready.", null)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ class FileUtils {
companion object {

fun getAssistantDirectory(appContext: Context): File {
val rootDir: File by lazy { appContext.filesDir }
val assistantDir by lazy { File(rootDir, "assistant") }
val rootDir: File = appContext.filesDir
val assistantDir = File(rootDir, "assistant")
Timber.d("Rood Dir: " + rootDir.path)
Timber.d("Assistant Dir: " + assistantDir.path)
return assistantDir
}

fun unzipAssistantDirectory(appContext: Context, version: String):Boolean {
val assistantDir = getAssistantDirectory(appContext)
val versionFile by lazy { File(assistantDir, "android_version_$version") }
val versionFile = File(assistantDir, "android_version_$version")
Timber.d("Unzip File Version Name: " + versionFile.name)
return !versionFile.exists()
}

fun doUnzipAssistantDirectory(appContext: Context, version: String): Boolean {
Timber.d("doUnzipAssistantDirectory")
val rootDir: File by lazy { appContext.filesDir }
val assistantDir by lazy { File(rootDir, "assistant") }
val versionFile by lazy { File(assistantDir, "android_version_$version") }
val rootDir: File = appContext.filesDir
val assistantDir: File = File(rootDir, "assistant")
val versionFile: File = File(assistantDir, "android_version_$version")
try {
assistantDir.deleteRecursively()
} catch (e: Exception) {
Expand Down

0 comments on commit 401a934

Please sign in to comment.