Skip to content
Open
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
3 changes: 3 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/coderGtm/yantra/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ enum class PermissionRequestCodes(val code: Int) {
BLUETOOTH(500),
NOTIFICATIONS(600),
TERMUX_RUN_COMMAND(700),
LOCATION(800),
}
enum class UserNotificationChannelConfig(val value: String) {
NAME("User Generated Notifications"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.canhub.cropper.CropImageContract
import com.canhub.cropper.CropImageContractOptions
import com.canhub.cropper.CropImageOptions
import com.canhub.cropper.CropImageView
import com.coderGtm.yantra.PermissionRequestCodes
import com.coderGtm.yantra.R
import com.coderGtm.yantra.SHARED_PREFS_FILE_NAME
import com.coderGtm.yantra.YantraLauncher
Expand Down Expand Up @@ -221,6 +222,10 @@ class MainActivity : AppCompatActivity(), TextToSpeech.OnInitListener, TerminalG
primaryTerminal.output(getString(R.string.permission_denied), primaryTerminal.theme.errorTextColor, null)
} else {
primaryTerminal.output(getString(R.string.permission_granted), primaryTerminal.theme.successTextColor, null)
// if location permission was granted, re-execute the location command
if (requestCode == PermissionRequestCodes.LOCATION.code) {
primaryTerminal.handleCommand("location")
}
}
}

Expand Down
Loading