-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/trunk' into merge/24.9-rc-2-to-t…
…runk
- Loading branch information
Showing
45 changed files
with
1,103 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# OS X generated file | ||
.DS_Store | ||
|
||
# Build-related files | ||
fastlane/ | ||
|
||
# Key-related files | ||
.jks | ||
.keystore | ||
|
||
# Backup files | ||
.bak | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
build/ | ||
build.log | ||
|
||
# Built application files | ||
.apk | ||
.ap_ | ||
.aab | ||
|
||
# Dex VM files | ||
.dex | ||
|
||
# Configuration files | ||
.configure | ||
.configure-files/ | ||
google-services.json | ||
google-upload-credentials.json | ||
firebase.secrets.json | ||
sentry.properties | ||
|
||
# Gradle files | ||
gradle.properties | ||
local.properties | ||
local-builds.gradle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
name: ☢️ Danger | ||
name: ☢️ Trigger Danger On Buildkite | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, ready_for_review, synchronize, edited, labeled, unlabeled, milestoned, demilestoned] | ||
types: [labeled, unlabeled, milestoned, demilestoned] | ||
|
||
jobs: | ||
dangermattic: | ||
# runs on draft PRs only for opened / synchronize events | ||
if: ${{ (github.event.pull_request.draft == false) || (github.event.pull_request.draft == true && contains(fromJSON('["opened", "synchronize"]'), github.event.action)) }} | ||
uses: Automattic/dangermattic/.github/workflows/reusable-run-danger.yml@v1.0.0 | ||
if: ${{ (github.event.pull_request.draft == false) }} | ||
uses: Automattic/dangermattic/.github/workflows/reusable-retry-buildkite-step-on-events.yml@v1.1.0 | ||
with: | ||
org-slug: "automattic" | ||
pipeline-slug: "wordpress-android" | ||
retry-step-key: "danger" | ||
build-commit-sha: "${{ github.event.pull_request.head.sha }}" | ||
secrets: | ||
github-token: ${{ secrets.DANGERMATTIC_GITHUB_TOKEN }} | ||
buildkite-api-token: ${{ secrets.TRIGGER_BK_BUILD_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...tpack/java/org/wordpress/android/util/config/InAppUpdateBlockingVersionConfigConstants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package org.wordpress.android.util.config | ||
|
||
const val IN_APP_UPDATE_BLOCKING_VERSION_REMOTE_FIELD = "jp_in_app_update_blocking_version_android" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
WordPress/src/main/java/org/wordpress/android/inappupdate/IInAppUpdateManager.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.wordpress.android.inappupdate | ||
|
||
import android.app.Activity | ||
|
||
interface IInAppUpdateManager { | ||
fun checkForAppUpdate(activity: Activity, listener: InAppUpdateListener) | ||
fun completeAppUpdate() | ||
fun cancelAppUpdate(updateType: Int) | ||
fun onUserAcceptedAppUpdate(updateType: Int) | ||
|
||
companion object { | ||
const val APP_UPDATE_IMMEDIATE_REQUEST_CODE = 1001 | ||
const val APP_UPDATE_FLEXIBLE_REQUEST_CODE = 1002 | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
WordPress/src/main/java/org/wordpress/android/inappupdate/InAppUpdateAnalyticsTracker.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.wordpress.android.inappupdate | ||
|
||
import com.google.android.play.core.install.model.AppUpdateType | ||
import org.wordpress.android.analytics.AnalyticsTracker | ||
import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper | ||
import javax.inject.Inject | ||
|
||
class InAppUpdateAnalyticsTracker @Inject constructor( | ||
private val tracker: AnalyticsTrackerWrapper | ||
) { | ||
fun trackUpdateShown(updateType: Int) { | ||
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_SHOWN, createPropertyMap(updateType)) | ||
} | ||
|
||
fun trackUpdateAccepted(updateType: Int) { | ||
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_ACCEPTED, createPropertyMap(updateType)) | ||
} | ||
|
||
fun trackUpdateDismissed(updateType: Int) { | ||
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_DISMISSED, createPropertyMap(updateType)) | ||
} | ||
|
||
fun trackAppRestartToCompleteUpdate() { | ||
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_COMPLETED_WITH_APP_RESTART) | ||
} | ||
|
||
private fun createPropertyMap(updateType: Int): Map<String, String> { | ||
return when (updateType) { | ||
AppUpdateType.FLEXIBLE -> mapOf(PROPERTY_UPDATE_TYPE to UPDATE_TYPE_FLEXIBLE) | ||
AppUpdateType.IMMEDIATE -> mapOf(PROPERTY_UPDATE_TYPE to UPDATE_TYPE_BLOCKING) | ||
else -> emptyMap() | ||
} | ||
} | ||
|
||
companion object { | ||
const val PROPERTY_UPDATE_TYPE = "type" | ||
const val UPDATE_TYPE_FLEXIBLE = "flexible" | ||
const val UPDATE_TYPE_BLOCKING = "blocking" | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
WordPress/src/main/java/org/wordpress/android/inappupdate/InAppUpdateListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.wordpress.android.inappupdate | ||
|
||
/** | ||
* Abstract class for handling callbacks related to in-app update events. | ||
* | ||
* Each method provides a default implementation that does nothing, allowing | ||
* implementers to only override the necessary methods without implementing | ||
* all callback methods. | ||
*/ | ||
abstract class InAppUpdateListener { | ||
open fun onAppUpdateStarted(type: Int) { | ||
// Default empty implementation | ||
} | ||
|
||
open fun onAppUpdateDownloaded() { | ||
// Default empty implementation | ||
} | ||
|
||
open fun onAppUpdateInstalled() { | ||
// Default empty implementation | ||
} | ||
|
||
open fun onAppUpdateFailed() { | ||
// Default empty implementation | ||
} | ||
|
||
open fun onAppUpdateCancelled() { | ||
// Default empty implementation | ||
} | ||
|
||
open fun onAppUpdatePending() { | ||
// Default empty implementation | ||
} | ||
} |
Oops, something went wrong.