Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6834 from woocommerce/screenshots-automation/fix-…
…locales-switching [Screenshots Automation] Fix locales switching
- Loading branch information
Showing
8 changed files
with
69 additions
and
30 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
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,29 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<manifest package="com.woocommerce.android" | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="com.woocommerce.android"> | ||
|
||
<!-- Allows unlocking your device and activating its screen so UI tests can succeed --> | ||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/> | ||
<uses-permission android:name="android.permission.WAKE_LOCK"/> | ||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | ||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
|
||
<!-- Allows for storing and retrieving screenshots --> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" /> | ||
<uses-permission | ||
android:name="android.permission.WRITE_EXTERNAL_STORAGE" | ||
android:maxSdkVersion="28" /> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | ||
|
||
<!-- Allows changing locales --> | ||
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" tools:ignore="ProtectedPermissions" /> | ||
<uses-permission | ||
android:name="android.permission.CHANGE_CONFIGURATION" | ||
tools:ignore="ProtectedPermissions" /> | ||
|
||
<!-- Clean the status bar for screenshots automation | ||
See https://docs.fastlane.tools/actions/screengrab/#clean-status-bar --> | ||
<!-- Indicates the use of the clean status bar feature --> | ||
<uses-feature android:name="tools.fastlane.screengrab.cleanstatusbar" /> | ||
<!-- Allows for changing the status bar --> | ||
<uses-permission android:name="android.permission.DUMP" tools:ignore="ProtectedPermissions" /> | ||
<uses-permission | ||
android:name="android.permission.DUMP" | ||
tools:ignore="ProtectedPermissions" /> | ||
|
||
<application | ||
android:name=".WooCommerceDebug" | ||
tools:replace="android:name" /> | ||
tools:replace="android:name"> | ||
<provider | ||
android:name=".LeakCanaryInstaller" | ||
android:authorities="${applicationId}.leakcanary-installer" | ||
android:exported="false" /> | ||
</application> | ||
|
||
</manifest> |
42 changes: 42 additions & 0 deletions
42
WooCommerce/src/debug/kotlin/com.woocommerce.android/LeakCanaryInstaller.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,42 @@ | ||
package com.woocommerce.android | ||
|
||
import android.app.Application | ||
import android.content.ContentProvider | ||
import android.content.ContentValues | ||
import android.database.Cursor | ||
import android.net.Uri | ||
import com.woocommerce.android.util.PackageUtils | ||
import com.woocommerce.android.util.WooLog | ||
import leakcanary.AppWatcher | ||
|
||
internal class LeakCanaryInstaller : ContentProvider() { | ||
override fun onCreate(): Boolean { | ||
if (!PackageUtils.isTesting()) { | ||
WooLog.v(WooLog.T.DEVICE, "Installing LeakCanary") | ||
val application = context!!.applicationContext as Application | ||
AppWatcher.manualInstall(application) | ||
} | ||
return true | ||
} | ||
|
||
override fun query( | ||
uri: Uri, | ||
projectionArg: Array<String>?, | ||
selection: String?, | ||
selectionArgs: Array<String>?, | ||
sortOrder: String? | ||
): Cursor? = null | ||
|
||
override fun getType(uri: Uri): String? = null | ||
|
||
override fun insert(uri: Uri, contentValues: ContentValues?): Uri? = null | ||
|
||
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int = 0 | ||
|
||
override fun update( | ||
uri: Uri, | ||
values: ContentValues?, | ||
selection: String?, | ||
selectionArgs: Array<out String>? | ||
): Int = 0 | ||
} |
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