Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9fb9799 authored by Charlie Boutier's avatar Charlie Boutier Committed by Gerrit Code Review
Browse files

Merge changes If4377414,I51676bef

* changes:
  [Pandora] - Enable hidden apis
  [Pandora] Adopt permission from the shell instead of the platform certificate
parents 0f3bf617 4b55d8b8
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -7,8 +7,6 @@ java_library_static {

    srcs: ["src/**/*.kt"],

    platform_apis: true,

    sdk_version: "core_platform",

    libs: [
@@ -33,7 +31,6 @@ java_library_static {

android_test_helper_app {
    name: "PandoraServer",
    certificate: "platform",

    static_libs: [
        "PandoraServerLib",
+0 −10
Original line number Diff line number Diff line
@@ -21,17 +21,7 @@
        <uses-library android:name="android.test.runner" />
    </application>

    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
    <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.LOCAL_MAC_ADDRESS" />

    <instrumentation android:name="com.android.pandora.Main"
                     android:targetPackage="com.android.pandora"
+2 −2
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@
        <option name="install-arg" value="-g" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.InstallApkSetup">
        <option name="post-install-cmd" value="am instrument -e Debug false com.android.pandora/.Main" />
    <target_preparer class="com.android.tradefed.targetprep.RunHostCommandTargetPreparer">
        <option name="host-background-command" value="adb -s $SERIAL shell am instrument --no-hidden-api-checks -w com.android.pandora/.Main" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.PythonVirtualenvPreparer">
+8 −2
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@
        <option name="install-arg" value="-g" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.InstallApkSetup">
        <option name="post-install-cmd" value="am instrument -e Debug false com.android.pandora/.Main" />
    <target_preparer class="com.android.tradefed.targetprep.RunHostCommandTargetPreparer">
        <option name="host-background-command" value="adb -s $SERIAL shell am instrument --no-hidden-api-checks -w com.android.pandora/.Main" />
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.PythonVirtualenvPreparer">
@@ -21,8 +21,13 @@
        <option name="tests-config-file" value="pts_bot_tests_config.json" />
        <option name="physical" value="false" />
        <option name="profile" value="A2DP/SRC" />
        <option name="profile" value="AVCTP" />
        <option name="profile" value="AVDTP/SRC" />
        <option name="profile" value="AVRCP" />
        <option name="profile" value="GATT/CL/GAC" />
        <option name="profile" value="GATT/CL/GAD" />
        <option name="profile" value="GATT/CL/GAR" />
        <option name="profile" value="GATT/CL/GAW" />
        <option name="profile" value="HFP/AG/DIS" />
        <option name="profile" value="HFP/AG/HFI" />
        <option name="profile" value="HFP/AG/SLC" />
@@ -31,6 +36,7 @@
        <option name="profile" value="SM/CEN/EKS" />
        <option name="profile" value="SM/CEN/JW" />
        <option name="profile" value="SM/CEN/KDU" />
        <option name="profile" value="HOGP/RH" />
    </test>

    <object type="module_controller"
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context
import android.os.Bundle
import android.os.Debug
import android.util.Log
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.core.app.ApplicationProvider.getApplicationContext
import androidx.test.runner.MonitoringInstrumentation

@@ -46,6 +47,9 @@ class Main : MonitoringInstrumentation() {
    super.onStart()

    val context: Context = getApplicationContext()
    val uiAutomation = InstrumentationRegistry.getInstrumentation().getUiAutomation()
    // Adopt all the permissions of the shell
    uiAutomation.adoptShellPermissionIdentity()

    while (true) {
      val server = Server(context)