Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import androidx.activity.OnBackPressedCallback
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
Expand Down Expand Up @@ -144,9 +145,18 @@ class PermissionsFragment : Fragment() {
view.findViewById<Button>(R.id.btnGrantUsagePermission).setOnClickListener {
startActivity(Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS))
}
// Handle grant accessibility permissions
// Handle grant accessibility permissions.
// Google Play's Accessibility API policy requires a prominent disclosure
// that the user affirmatively accepts before being sent to enable the service.
view.findViewById<Button>(R.id.btnGrantAccessibilityPermission).setOnClickListener {
startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS))
AlertDialog.Builder(requireContext())
.setTitle(R.string.accessibility_disclosure_title)
.setMessage(R.string.accessibility_disclosure_message)
.setPositiveButton(R.string.accessibility_disclosure_agree) { _, _ ->
startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS))
}
.setNegativeButton(R.string.accessibility_disclosure_decline, null)
.show()
}
// Handle grant exact alarm permissions (for widgets)
view.findViewById<Button>(R.id.btnGrantExactAlarmPermission).setOnClickListener {
Expand Down
8 changes: 8 additions & 0 deletions mobile/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
<string name="button_log_text">Click me to log data!</string>
<string name="accessibility_service_description">Allows ActivityWatch to read the URL and title from your browser.</string>

<!-- Prominent disclosure required by the Google Play Accessibility API policy:
must be shown and affirmatively accepted BEFORE directing the user to
enable the accessibility service. -->
<string name="accessibility_disclosure_title">Web browsing tracking</string>
<string name="accessibility_disclosure_message">To track your web browsing activity, ActivityWatch uses Android\'s Accessibility API to read the URL and page title from your browser while you browse.\n\nThis data is processed and stored only on your device. It is never sent to the ActivityWatch developers or any third party.\n\nIf you agree, enable ActivityWatch under Accessibility settings on the next screen. This is optional — the rest of the app works without it.</string>
<string name="accessibility_disclosure_agree">Agree</string>
<string name="accessibility_disclosure_decline">No thanks</string>

<!-- This is overridden by gradle config
<string name="versionName">unknown version</string>-->

Expand Down
Loading