Skip to content

Commit

Permalink
Restrict adding self-hosted site in Jetpack app using build config co…
Browse files Browse the repository at this point in the history
…nstant
  • Loading branch information
ashiagr committed Feb 10, 2022
1 parent 861ad82 commit 4519984
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ android {

// Override these constants in jetpack product flavor to enable/ disable features
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
buildConfigField "boolean", "ENABLE_ADD_SELF_HOSTED_SITE", "true"

manifestPlaceholders = [magicLinkScheme:"wordpress"]
}
Expand Down Expand Up @@ -155,6 +156,7 @@ android {
applicationId "com.jetpack.android"
buildConfigField "boolean", "IS_JETPACK_APP", "true"
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
buildConfigField "boolean", "ENABLE_ADD_SELF_HOSTED_SITE", "false"
buildConfigField "String", "TRACKS_EVENT_PREFIX", '"jpandroid_"'
buildConfigField "String", "PUSH_NOTIFICATIONS_APP_KEY", '"com.jetpack.android"'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,7 @@ public void onDestroyActionMode(ActionMode actionMode) {

public static void addSite(Activity activity, boolean hasAccessToken) {
if (hasAccessToken) {
if (BuildConfig.IS_JETPACK_APP) {
// user is signed into jetpack app, so restrict showing option to add self-hosted site
if (!BuildConfig.ENABLE_ADD_SELF_HOSTED_SITE) {
ActivityLauncher.newBlogForResult(activity);
} else {
// user is signed into wordpress app, so use the dialog to enable choosing whether to
Expand Down

0 comments on commit 4519984

Please sign in to comment.