Skip to content

Commit

Permalink
Merge branch 'trunk' into feature/notifications_refresh_p2
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonis Lilis committed Jun 11, 2024
2 parents 34a279c + 71b4b52 commit 987d1f7
Show file tree
Hide file tree
Showing 145 changed files with 2,839 additions and 1,294 deletions.
4 changes: 4 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
*** PLEASE FOLLOW THIS FORMAT: [<priority indicator, more stars = higher priority>] <description> [<PR URL>]

25.2
-----


25.1
-----
* [*] [internal] Block editor: Add onContentUpdate bridge functionality [https://github.com/wordpress-mobile/gutenberg-mobile/pull/20852]
Expand Down
1 change: 1 addition & 0 deletions WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ android {
buildConfigField "boolean", "READER_TAGS_FEED", "false"
buildConfigField "boolean", "READER_ANNOUNCEMENT_CARD", "false"
buildConfigField "boolean", "VOICE_TO_CONTENT", "false"
buildConfigField "boolean", "READER_FLOATING_BUTTON", "false"

// Override these constants in jetpack product flavor to enable/ disable features
buildConfigField "boolean", "ENABLE_SITE_CREATION", "true"
Expand Down
3 changes: 1 addition & 2 deletions WordPress/jetpack_metadata/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
The Tags feed is live! You can now see content with specific tags, all in one place. Tag, you’re it.
* [*] [internal] Block editor: Add onContentUpdate bridge functionality [https://github.com/wordpress-mobile/gutenberg-mobile/pull/20852]

We fixed assorted crashes on the login and Posts List screens, as well as actions associated with blogging reminders, feature images, and user removal. Less crashing? How smashing.
3 changes: 2 additions & 1 deletion WordPress/metadata/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
We fixed assorted crashes on the login and Posts List screens, as well as actions associated with blogging reminders, feature images, and user removal. Less crashing? How smashing.
* [*] [internal] Block editor: Add onContentUpdate bridge functionality [https://github.com/wordpress-mobile/gutenberg-mobile/pull/20852]

1 change: 1 addition & 0 deletions WordPress/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />

<!-- GCM all build types configuration -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.wordpress.android.datasets

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

/**
* Helper class to handle asynchronous I/O tasks using coroutines
* @see <a href="https://github.com/wordpress-mobile/WordPress-Android/pull/20937">Introduction</a>
*/
object AsyncTaskExecutor {
/**
* Execute a data loading task in the IO thread and handle the result on the main thread
*/
@JvmStatic
fun <T> executeIo(scope: CoroutineScope, backgroundTask: () -> T, callback: AsyncTaskCallback<T>) {
execute(scope, Dispatchers.IO, backgroundTask, callback)
}

/**
* Execute a data loading task in the default thread and handle the result on the main thread
*/
@JvmStatic
fun <T> executeDefault(scope: CoroutineScope, backgroundTask: () -> T, callback: AsyncTaskCallback<T>) {
execute(scope, Dispatchers.Default, backgroundTask, callback)
}

private fun <T> execute(
scope: CoroutineScope,
dispatcher: CoroutineDispatcher,
backgroundTask: () -> T,
callback: AsyncTaskCallback<T>
) {
scope.launch(dispatcher) {
// handle the background task
val result = backgroundTask()

withContext(Dispatchers.Main) {
// handle the result on the main thread
callback.onTaskFinished(result)
}
}
}

interface AsyncTaskCallback<T> {
fun onTaskFinished(result: T)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class InAppUpdateAnalyticsTracker @Inject constructor(
}

fun trackAppRestartToCompleteUpdate() {
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_COMPLETED_WITH_APP_RESTART)
tracker.track(AnalyticsTracker.Stat.IN_APP_UPDATE_COMPLETED_WITH_APP_RESTART_BY_USER)
}

private fun createPropertyMap(updateType: Int): Map<String, String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import com.google.android.play.core.install.model.UpdateAvailability.DEVELOPER_T
import com.google.android.play.core.install.model.UpdateAvailability.UPDATE_AVAILABLE
import com.google.android.play.core.install.model.UpdateAvailability.UPDATE_NOT_AVAILABLE
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.wordpress.android.inappupdate.IInAppUpdateManager.Companion.APP_UPDATE_FLEXIBLE_REQUEST_CODE
import org.wordpress.android.inappupdate.IInAppUpdateManager.Companion.APP_UPDATE_IMMEDIATE_REQUEST_CODE

Expand All @@ -33,6 +37,7 @@ import javax.inject.Singleton
@Suppress("TooManyFunctions")
class InAppUpdateManagerImpl(
@ApplicationContext private val applicationContext: Context,
private val coroutineScope: CoroutineScope,
private val appUpdateManager: AppUpdateManager,
private val remoteConfigWrapper: RemoteConfigWrapper,
private val buildConfigWrapper: BuildConfigWrapper,
Expand All @@ -51,8 +56,16 @@ class InAppUpdateManagerImpl(
}

override fun completeAppUpdate() {
inAppUpdateAnalyticsTracker.trackAppRestartToCompleteUpdate()
appUpdateManager.completeUpdate()
coroutineScope.launch(Dispatchers.Main) {
// Track the app restart to complete update
inAppUpdateAnalyticsTracker.trackAppRestartToCompleteUpdate()

// Delay so the event above can be logged
delay(RESTART_DELAY_IN_MILLIS)

// Complete the update
appUpdateManager.completeUpdate()
}
}

override fun cancelAppUpdate(updateType: Int) {
Expand Down Expand Up @@ -226,5 +239,6 @@ class InAppUpdateManagerImpl(
private const val TAG = "AppUpdateChecker"
private const val PREF_NAME = "in_app_update_prefs"
private const val KEY_LAST_APP_UPDATE_CHECK_VERSION = "last_app_update_check_version"
private const val RESTART_DELAY_IN_MILLIS = 500L
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@
import org.wordpress.android.viewmodel.helpers.ConnectionStatus;
import org.wordpress.android.viewmodel.helpers.ConnectionStatusLiveData;

import javax.inject.Named;

import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import dagger.android.AndroidInjectionModule;
import dagger.hilt.InstallIn;
import dagger.hilt.android.qualifiers.ApplicationContext;
import dagger.hilt.components.SingletonComponent;
import kotlinx.coroutines.CoroutineScope;
import static org.wordpress.android.modules.ThreadModuleKt.APPLICATION_SCOPE;

@InstallIn(SingletonComponent.class)
@Module(includes = AndroidInjectionModule.class)
Expand Down Expand Up @@ -98,6 +102,7 @@ public static AppUpdateManager provideAppUpdateManager(@ApplicationContext Conte
@Provides
public static IInAppUpdateManager provideInAppUpdateManager(
@ApplicationContext Context context,
@Named(APPLICATION_SCOPE) CoroutineScope appScope,
AppUpdateManager appUpdateManager,
RemoteConfigWrapper remoteConfigWrapper,
BuildConfigWrapper buildConfigWrapper,
Expand All @@ -108,6 +113,7 @@ public static IInAppUpdateManager provideInAppUpdateManager(
return inAppUpdatesFeatureConfig.isEnabled()
? new InAppUpdateManagerImpl(
context,
appScope,
appUpdateManager,
remoteConfigWrapper,
buildConfigWrapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {

protected void addSignupEpilogueFragment(String name, String email, String photoUrl, String username,
boolean isEmail) {
SignupEpilogueFragment signupEpilogueSocialFragment = SignupEpilogueFragment.newInstance(
SignupEpilogueFragment signupEpilogueSocialFragment = SignupEpilogueFragment.Companion.newInstance(
name, email, photoUrl, username, isEmail);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.fragment_container, signupEpilogueSocialFragment, SignupEpilogueFragment.TAG);
Expand Down
Loading

0 comments on commit 987d1f7

Please sign in to comment.