forked from videolan/vlc-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicolas Pomepuy
committed
Sep 30, 2020
1 parent
73b9a42
commit ab41d93
Showing
63 changed files
with
1,118 additions
and
168 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 |
---|---|---|
|
@@ -68,3 +68,4 @@ libvlc.pc | |
libvlc.pc.backup | ||
libvlcpp.pc | ||
lib/ | ||
/buildsystem/automation/certificates/ |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- | ||
~ ************************************************************************* | ||
~ AndroidManifest.xml | ||
~ ************************************************************************** | ||
~ Copyright © 2020 VLC authors and VideoLAN | ||
~ Author: Nicolas POMEPUY | ||
~ This program is free software; you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation; either version 2 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program; if not, write to the Free Software | ||
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. | ||
~ *************************************************************************** | ||
~ | ||
~ | ||
--> | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="org.videolan.mobile.app"> | ||
|
||
<uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator, tools.fastlane.screengrab" /> | ||
</manifest> |
24 changes: 0 additions & 24 deletions
24
application/app/src/androidTest/java/org/videolan/mobile/app/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
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
67 changes: 67 additions & 0 deletions
67
application/app/src/androidTest/java/org/videolan/vlc/DemoModeEnabler.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,67 @@ | ||
/* | ||
* ************************************************************************ | ||
* DemoModeEnabler.kt | ||
* ************************************************************************* | ||
* Copyright © 2020 VLC authors and VideoLAN | ||
* Author: Nicolas POMEPUY | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. | ||
* ************************************************************************** | ||
* | ||
* | ||
*/ | ||
|
||
package org.videolan.vlc | ||
|
||
import android.os.ParcelFileDescriptor | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import java.io.BufferedReader | ||
import java.io.InputStreamReader | ||
|
||
class DemoModeEnabler { | ||
|
||
fun enable() { | ||
executeShellCommand("settings put global sysui_demo_allowed 1") | ||
sendCommand("exit") | ||
sendCommand("enter") | ||
sendCommand("notifications", "visible" to "false") | ||
sendCommand("network", "wifi" to "show", "level" to "4", "fully" to "true") | ||
sendCommand("network", "mobile" to "show", "level" to "4", "datatype" to "4g") | ||
sendCommand("battery", "level" to "100", "plugged" to "true") | ||
sendCommand("clock", "hhmm" to "1000") | ||
} | ||
|
||
fun disable() { | ||
sendCommand("exit") | ||
} | ||
|
||
private fun sendCommand(command: String, vararg extras: Pair<String, Any>) { | ||
val exec = StringBuilder("am broadcast -a com.android.systemui.demo -e command $command") | ||
for ((key, value) in extras) { | ||
exec.append(" -e $key $value") | ||
} | ||
executeShellCommand(exec.toString()) | ||
} | ||
|
||
private fun executeShellCommand(command: String) { | ||
waitForCompletion(InstrumentationRegistry.getInstrumentation().uiAutomation.executeShellCommand(command)) | ||
} | ||
|
||
private fun waitForCompletion(descriptor: ParcelFileDescriptor) { | ||
val reader = BufferedReader(InputStreamReader(ParcelFileDescriptor.AutoCloseInputStream(descriptor))) | ||
reader.use { | ||
it.readText() | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
application/app/src/androidTest/java/org/videolan/vlc/DemoModeRule.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,44 @@ | ||
/* | ||
* ************************************************************************ | ||
* DemoModeRule.kt | ||
* ************************************************************************* | ||
* Copyright © 2020 VLC authors and VideoLAN | ||
* Author: Nicolas POMEPUY | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. | ||
* ************************************************************************** | ||
* | ||
* | ||
*/ | ||
|
||
package org.videolan.vlc | ||
|
||
import org.junit.rules.TestRule | ||
import org.junit.runner.Description | ||
import org.junit.runners.model.Statement | ||
|
||
class DemoModeRule : TestRule { | ||
|
||
private val helper = DemoModeEnabler() | ||
|
||
override fun apply(base: Statement, description: Description): Statement = DemoModeStatement(base) | ||
|
||
private inner class DemoModeStatement(private val base: Statement) : Statement() { | ||
override fun evaluate() { | ||
helper.enable() | ||
base.evaluate() | ||
helper.disable() | ||
} | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.