Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into bug1877203
Browse files Browse the repository at this point in the history
  • Loading branch information
ohall-m authored Feb 13, 2024
2 parents 3e12723 + 0df7d35 commit 2d28007
Show file tree
Hide file tree
Showing 128 changed files with 2,391 additions and 931 deletions.
1 change: 1 addition & 0 deletions android-components/components/feature/addons/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ android {

ksp {
arg("room.schemaLocation", "$projectDir/schemas".toString())
arg("room.generateKotlin", "true")
}

javaCompileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class AddonsManagerAdapter(
val reviewCount = context.getString(R.string.mozac_feature_addons_user_rating_count_2)
val ratingContentDescription =
String.format(
context.getString(R.string.mozac_feature_addons_rating_content_description),
context.getString(R.string.mozac_feature_addons_rating_content_description_2),
it.average,
)
holder.ratingView.contentDescription = ratingContentDescription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
then we will show another collapsed entry saying "Access your data on 2 other domains". This entry it's for the plural case, when the add-on is accessing more than one extra domain.
%1$d will be replaced by an integer indicating the number of additional domains for which this web extension is requesting permission. -->
<string name="mozac_feature_addons_permissions_extra_domains_description_plural" tools:ignore="PluralsCandidate">Accede à i vostri dati per %1$d altri duminii</string>
<!-- Content description for a permission item, for an installed add-on details page. %1$s will be replaced with the permission text name, %2$d will be replaced with the permission position in the list and %3$d will be replaced with the total number of permissions in the list.Taking as an example "Read and modify privacy settings" the whole text will read Read and modify privacy settings, 2 of 6. -->
<string name="mozac_feature_addons_permissions_content_description_item">%1$s, %2$d nant’à %3$d</string>
<!-- Description for tabs add-on permission. -->
<string name="mozac_feature_addons_permissions_tabs_description">Accede à l’unghjette di u navigatore</string>
<!-- Description for unlimited_storage permission. -->
Expand Down Expand Up @@ -75,7 +77,7 @@
<!-- The author of an add-on. -->
<string name="mozac_feature_addons_author">Autore</string>
<!-- The authors of an add-on. -->
<string name="mozac_feature_addons_authors" moz:removedIn="120" tools:ignore="UnusedResources">Autori</string>
<string name="mozac_feature_addons_authors" moz:removedIn="123" tools:ignore="UnusedResources">Autori</string>
<!-- The last date that the add-on was updated. -->
<string name="mozac_feature_addons_last_updated">Ultima mudificazione</string>
<!-- The developer website (Homepage) of the add-on. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
<!-- Text shown in not yet supported add-ons section in AddonsManagerAdapter - plural. %1$s is the number of unsupported add-ons -->
<string name="mozac_feature_addons_unsupported_caption_plural">%1$s ychwanegyn</string>
<!-- Text link to a sumo page for learning more about unsupported add-ons. -->
<string name="mozac_feature_addons_unsupported_learn_more">Dysgu rhagor</string>
<string name="mozac_feature_addons_unsupported_learn_more">Darllen rhagor</string>
<!-- Displayed in the "Status" field for the updater when an add-on has been correctly updated. -->
<string name="mozac_feature_addons_updater_status_successfully_updated">Wedi’i ddiweddaru’n llwyddiannus</string>
<!-- Displayed in the "Status" field for the updater when an add-on has no updates available. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
then we will show another collapsed entry saying "Access your data on 2 other domains". This entry it's for the plural case, when the add-on is accessing more than one extra domain.
%1$d will be replaced by an integer indicating the number of additional domains for which this web extension is requesting permission. -->
<string name="mozac_feature_addons_permissions_extra_domains_description_plural" tools:ignore="PluralsCandidate">Aliri viajn datumojn de %1$d aliaj nomregnoj</string>
<!-- Content description for a permission item, for an installed add-on details page. %1$s will be replaced with the permission text name, %2$d will be replaced with the permission position in the list and %3$d will be replaced with the total number of permissions in the list.Taking as an example "Read and modify privacy settings" the whole text will read Read and modify privacy settings, 2 of 6. -->
<string name="mozac_feature_addons_permissions_content_description_item">%1$s, %2$d el %3$d</string>
<!-- Description for tabs add-on permission. -->
<string name="mozac_feature_addons_permissions_tabs_description">Aliri retumilajn langetojn</string>
<!-- Description for unlimited_storage permission. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
then we will show another collapsed entry saying "Access your data on 2 other domains". This entry it's for the plural case, when the add-on is accessing more than one extra domain.
%1$d will be replaced by an integer indicating the number of additional domains for which this web extension is requesting permission. -->
<string name="mozac_feature_addons_permissions_extra_domains_description_plural" tools:ignore="PluralsCandidate">Beste %1$d domeinutan zure datuak atzitzea</string>
<!-- Content description for a permission item, for an installed add-on details page. %1$s will be replaced with the permission text name, %2$d will be replaced with the permission position in the list and %3$d will be replaced with the total number of permissions in the list.Taking as an example "Read and modify privacy settings" the whole text will read Read and modify privacy settings, 2 of 6. -->
<string name="mozac_feature_addons_permissions_content_description_item">%1$s, %2$d of %3$d</string>
<!-- Description for tabs add-on permission. -->
<string name="mozac_feature_addons_permissions_tabs_description">Nabigatzailearen fitxak atzitzea</string>
<!-- Description for unlimited_storage permission. -->
Expand Down Expand Up @@ -75,7 +77,7 @@
<!-- The author of an add-on. -->
<string name="mozac_feature_addons_author">Egilea</string>
<!-- The authors of an add-on. -->
<string name="mozac_feature_addons_authors" moz:removedIn="120" tools:ignore="UnusedResources">Egileak</string>
<string name="mozac_feature_addons_authors" moz:removedIn="123" tools:ignore="UnusedResources">Egileak</string>
<!-- The last date that the add-on was updated. -->
<string name="mozac_feature_addons_last_updated">Azken eguneraketa</string>
<!-- The developer website (Homepage) of the add-on. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
then we will show another collapsed entry saying "Access your data on 2 other domains". This entry it's for the plural case, when the add-on is accessing more than one extra domain.
%1$d will be replaced by an integer indicating the number of additional domains for which this web extension is requesting permission. -->
<string name="mozac_feature_addons_permissions_extra_domains_description_plural" tools:ignore="PluralsCandidate">その他 %1$d ドメイン上のデータへのアクセス</string>
<!-- Content description for a permission item, for an installed add-on details page. %1$s will be replaced with the permission text name, %2$d will be replaced with the permission position in the list and %3$d will be replaced with the total number of permissions in the list.Taking as an example "Read and modify privacy settings" the whole text will read Read and modify privacy settings, 2 of 6. -->
<string name="mozac_feature_addons_permissions_content_description_item">%1$s、%2$d / %3$d</string>
<!-- Description for tabs add-on permission. -->
<string name="mozac_feature_addons_permissions_tabs_description">ブラウザーのタブへのアクセス</string>
<!-- Description for unlimited_storage permission. -->
Expand Down Expand Up @@ -75,7 +77,7 @@
<!-- The author of an add-on. -->
<string name="mozac_feature_addons_author">作者</string>
<!-- The authors of an add-on. -->
<string name="mozac_feature_addons_authors" moz:removedIn="120" tools:ignore="UnusedResources">作者</string>
<string name="mozac_feature_addons_authors" moz:removedIn="123" tools:ignore="UnusedResources">作者</string>
<!-- The last date that the add-on was updated. -->
<string name="mozac_feature_addons_last_updated">最終更新日時</string>
<!-- The developer website (Homepage) of the add-on. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
then we will show another collapsed entry saying "Access your data on 2 other domains". This entry it's for the plural case, when the add-on is accessing more than one extra domain.
%1$d will be replaced by an integer indicating the number of additional domains for which this web extension is requesting permission. -->
<string name="mozac_feature_addons_permissions_extra_domains_description_plural" tools:ignore="PluralsCandidate">Få tilgang til dine data på %1$d andre domener</string>
<!-- Content description for a permission item, for an installed add-on details page. %1$s will be replaced with the permission text name, %2$d will be replaced with the permission position in the list and %3$d will be replaced with the total number of permissions in the list.Taking as an example "Read and modify privacy settings" the whole text will read Read and modify privacy settings, 2 of 6. -->
<string name="mozac_feature_addons_permissions_content_description_item">%1$s, %2$d av %3$d</string>
<!-- Description for tabs add-on permission. -->
<string name="mozac_feature_addons_permissions_tabs_description">Få tilgang til faner</string>
<!-- Description for unlimited_storage permission. -->
Expand Down Expand Up @@ -75,7 +77,7 @@
<!-- The author of an add-on. -->
<string name="mozac_feature_addons_author">Utvikler</string>
<!-- The authors of an add-on. -->
<string name="mozac_feature_addons_authors" moz:removedIn="120" tools:ignore="UnusedResources">Utviklere</string>
<string name="mozac_feature_addons_authors" moz:removedIn="123" tools:ignore="UnusedResources">Utviklere</string>
<!-- The last date that the add-on was updated. -->
<string name="mozac_feature_addons_last_updated">Sist oppdatert</string>
<!-- The developer website (Homepage) of the add-on. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
then we will show another collapsed entry saying "Access your data on 2 other domains". This entry it's for the plural case, when the add-on is accessing more than one extra domain.
%1$d will be replaced by an integer indicating the number of additional domains for which this web extension is requesting permission. -->
<string name="mozac_feature_addons_permissions_extra_domains_description_plural" tools:ignore="PluralsCandidate">Dostęp do danych użytkownika w %1$d innych domenach</string>
<!-- Content description for a permission item, for an installed add-on details page. %1$s will be replaced with the permission text name, %2$d will be replaced with the permission position in the list and %3$d will be replaced with the total number of permissions in the list.Taking as an example "Read and modify privacy settings" the whole text will read Read and modify privacy settings, 2 of 6. -->
<string name="mozac_feature_addons_permissions_content_description_item">%1$s, %2$d z %3$d</string>
<!-- Description for tabs add-on permission. -->
<string name="mozac_feature_addons_permissions_tabs_description">Dostęp do kart przeglądarki</string>
<!-- Description for unlimited_storage permission. -->
Expand Down Expand Up @@ -75,7 +77,7 @@
<!-- The author of an add-on. -->
<string name="mozac_feature_addons_author">Autor</string>
<!-- The authors of an add-on. -->
<string name="mozac_feature_addons_authors" moz:removedIn="120" tools:ignore="UnusedResources">Autorzy</string>
<string name="mozac_feature_addons_authors" moz:removedIn="123" tools:ignore="UnusedResources">Autorzy</string>
<!-- The last date that the add-on was updated. -->
<string name="mozac_feature_addons_last_updated">Ostatnia aktualizacja</string>
<!-- The developer website (Homepage) of the add-on. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
then we will show another collapsed entry saying "Access your data on 2 other domains". This entry it's for the plural case, when the add-on is accessing more than one extra domain.
%1$d will be replaced by an integer indicating the number of additional domains for which this web extension is requesting permission. -->
<string name="mozac_feature_addons_permissions_extra_domains_description_plural" tools:ignore="PluralsCandidate">Acceder a tias datas per %1$d autras domenas</string>
<!-- Content description for a permission item, for an installed add-on details page. %1$s will be replaced with the permission text name, %2$d will be replaced with the permission position in the list and %3$d will be replaced with the total number of permissions in the list.Taking as an example "Read and modify privacy settings" the whole text will read Read and modify privacy settings, 2 of 6. -->
<string name="mozac_feature_addons_permissions_content_description_item">%1$s, %2$d da %3$d</string>
<!-- Description for tabs add-on permission. -->
<string name="mozac_feature_addons_permissions_tabs_description">Acceder als tabs dal navigatur</string>
<!-- Description for unlimited_storage permission. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@
<!-- Indicates how many users have rated an add-on. %1$s will be replaced with number of reviews -->
<string name="mozac_feature_addons_user_rating_count_2">Reviews: %1$s</string>
<!-- Accessibility content description for the amount of stars that add-on has, where %1$.02f will be the amount of stars and / separator and 5 the maximum number of stars e.g (2/5, 4.5/5 or 5/5) . -->
<string name="mozac_feature_addons_rating_content_description">%1$.02f/5</string>
<string name="mozac_feature_addons_rating_content_description" moz:removedIn="124" tools:ignore="UnusedResources">%1$.02f/5</string>
<!-- Accessibility content description for the amount of stars that add-on has, where %1$.02f will be the amount of stars. -->
<string name="mozac_feature_addons_rating_content_description_2">Rating: %1$.02f out of 5</string>
<!-- This is the title of page where all the add-ons are listed-->
<string name="mozac_feature_addons_addons">Add-ons</string>
<!-- Label for add-ons sub menu item for add-ons manager-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class AddonsManagerAdapterTest {

adapter.bindAddon(addonViewHolder, addon, appName, appVersion)

verify(ratingAccessibleView).setText("4.50/5")
verify(ratingAccessibleView).setText("Rating: 4.50 out of 5")
verify(titleView).setText("name")
verify(titleView).setTextColor(ContextCompat.getColor(testContext, style.addonNameTextColor!!))
verify(summaryView).setText("summary")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<string name="mozac_feature_applinks_open_in">Ava link äpiga…</string>
<!-- The description to warn users that their private browsing session changes -->
<string name="mozac_feature_applinks_confirm_dialog_title">Kas soovid avada äpis? Sinu tegevus ei pruugi siis enam privaatne olla.</string>
<!-- The title of the prompt that warns users their normal browsing session is trying to open another app -->
<string name="mozac_feature_applinks_normal_confirm_dialog_title">Ava teises äpis</string>
<!-- The message of the prompt to confirm with users that they want to open the link in another app
%s is a placeholder that will be replaced by the app name -->
<string name="mozac_feature_applinks_normal_confirm_dialog_message">Kas soovid selle sisu vaatamiseks %sist lahkuda?</string>
<!-- Opens the selected time -->
<string name="mozac_feature_applinks_confirm_dialog_confirm">Ava</string>
<!-- Cancels the prompt -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ android {

ksp {
arg("room.schemaLocation", "$projectDir/schemas".toString())
arg("room.generateKotlin", "true")
}

javaCompileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ android {

ksp {
arg("room.schemaLocation", "$projectDir/schemas".toString())
arg("room.generateKotlin", "true")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package mozilla.components.feature.downloads
import android.content.Context
import androidx.room.Room
import androidx.room.testing.MigrationTestHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory
import androidx.test.core.app.ApplicationProvider
import androidx.test.platform.app.InstrumentationRegistry
import kotlinx.coroutines.ExperimentalCoroutinesApi
Expand All @@ -32,11 +31,9 @@ class OnDeviceDownloadStorageTest {
private lateinit var database: DownloadsDatabase

@get:Rule
@Suppress("DEPRECATION")
val helper: MigrationTestHelper = MigrationTestHelper(
InstrumentationRegistry.getInstrumentation(),
DownloadsDatabase::class.java.canonicalName,
FrameworkSQLiteOpenHelperFactory(),
DownloadsDatabase::class.java,
)

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,29 @@ internal abstract class DownloadsDatabase : RoomDatabase() {
@Suppress("MaxLineLength", "MagicNumber")
internal object Migrations {
val migration_1_2 = object : Migration(1, 2) {
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL(
override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL(
"ALTER TABLE downloads ADD COLUMN is_private INTEGER NOT NULL DEFAULT 0",
)
}
}
val migration_2_3 = object : Migration(2, 3) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
// Create a temporal table
database.execSQL("CREATE TABLE temp_downloads (`id` TEXT NOT NULL, `url` TEXT NOT NULL, `file_name` TEXT, `content_type` TEXT, `content_length` INTEGER, `status` INTEGER NOT NULL, `destination_directory` TEXT NOT NULL, `created_at` INTEGER NOT NULL, PRIMARY KEY(`id`))")
db.execSQL("CREATE TABLE temp_downloads (`id` TEXT NOT NULL, `url` TEXT NOT NULL, `file_name` TEXT, `content_type` TEXT, `content_length` INTEGER, `status` INTEGER NOT NULL, `destination_directory` TEXT NOT NULL, `created_at` INTEGER NOT NULL, PRIMARY KEY(`id`))")
// Copy the data
database.execSQL("INSERT INTO temp_downloads (id,url,file_name,content_type,content_length,status,destination_directory,created_at) SELECT id,url,file_name,content_type,content_length,status,destination_directory,created_at FROM downloads where is_private = 0")
db.execSQL("INSERT INTO temp_downloads (id,url,file_name,content_type,content_length,status,destination_directory,created_at) SELECT id,url,file_name,content_type,content_length,status,destination_directory,created_at FROM downloads where is_private = 0")
// Remove the old table
database.execSQL("DROP TABLE downloads")
db.execSQL("DROP TABLE downloads")
// Rename the table name to the correct one
database.execSQL("ALTER TABLE temp_downloads RENAME TO downloads")
db.execSQL("ALTER TABLE temp_downloads RENAME TO downloads")
}
}

val migration_3_4 = object : Migration(3, 4) {
override fun migrate(database: SupportSQLiteDatabase) {
override fun migrate(db: SupportSQLiteDatabase) {
// Clear any data urls.
database.execSQL("UPDATE downloads SET url='' WHERE url LIKE 'data:%' ")
db.execSQL("UPDATE downloads SET url='' WHERE url LIKE 'data:%' ")
}
}
}
Expand Down
Loading

0 comments on commit 2d28007

Please sign in to comment.