Skip to content

Commit

Permalink
fix viewPermissionsBtn not disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
basti564 committed Jun 4, 2022
1 parent 1b03724 commit d1c1ac0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/src/main/java/com/bos/oculess/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class MainActivity : AppCompatActivity() {
DevAdminReceiver::class.java
)

var flagEnabledButtonsOnce = false

fixedRateTimer("timer", false, 0L, 1000) {
this@MainActivity.runOnUiThread {
if (dpm.isAdminActive(
Expand All @@ -127,9 +129,12 @@ class MainActivity : AppCompatActivity() {
viewAdminsBtn.text = getString(R.string.enable_companion)
}
if (dpm.isDeviceOwnerApp(packageName)) {
viewOtaBtn.isEnabled = true
viewTelemetryBtn.isEnabled = true
viewPermissionsBtn.isEnabled = true
if (!flagEnabledButtonsOnce) {
viewOtaBtn.isEnabled = true
viewTelemetryBtn.isEnabled = true
viewPermissionsBtn.isEnabled = true
flagEnabledButtonsOnce = true
}

if (dpm.isApplicationHidden(
deviceAdminReceiverComponentName, updaterName
Expand Down

0 comments on commit d1c1ac0

Please sign in to comment.