Skip to content

Commit

Permalink
Use application ID variable when granting permissions during tests
Browse files Browse the repository at this point in the history
To facilitate working with multiple dev builds.
  • Loading branch information
amberin committed Sep 9, 2024
1 parent fa6336f commit 76be3b9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import androidx.test.espresso.util.HumanReadables;
import androidx.test.espresso.util.TreeIterables;

import com.orgzly.BuildConfig;
import com.orgzly.R;
import com.orgzly.android.ui.SpanUtils;

Expand Down Expand Up @@ -510,7 +511,7 @@ public void perform(final UiController uiController, final View view) {

public static void grantAlarmsAndRemindersPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
String shellCmd = "appops set --uid com.orgzlyrevived SCHEDULE_EXACT_ALARM allow";
String shellCmd = "appops set --uid " + BuildConfig.APPLICATION_ID + " SCHEDULE_EXACT_ALARM allow";
getInstrumentation().getUiAutomation().executeShellCommand(shellCmd);
}
}
Expand Down

0 comments on commit 76be3b9

Please sign in to comment.