diff options
author | Matt Wachowski <mattwach@google.com> | 2020-10-14 14:47:02 -0700 |
---|---|---|
committer | Matt Wachowski <mattwach@google.com> | 2020-10-14 14:47:02 -0700 |
commit | 7c20bf7eeb19ce5e97ac994e25259a3fdb077ed3 (patch) | |
tree | 2eab696b2552833ac9ebdb321f4a1f620318c580 /TvProvision | |
parent | c2d102b1329425f02cdd8198c7268d4b604f7a00 (diff) | |
download | atv-7c20bf7eeb19ce5e97ac994e25259a3fdb077ed3.tar.gz |
Enable adb connection on user builds.
This is an emulator-only change. In order to use
tools (e.g. cts, android studio) as expected, we need ADB
enabled by default. Without this change, adb only works with
userdebug builds or if you go into the UI of the emulator and
enable "USB Debugging" manually.
This change makes the TV emulator work like the phone
emulator. The equivilent phone code is located at
http://cs/android/vendor/google/sdk/GoogleSdkSetup/src/com/google/android/sdksetup/DefaultActivity.java?l=59&rcl=1fe3f9a12e15fed7fa64824fb25cec55968b6b6c
Bug: b/170487716
Test: Launched the TV emulator, asserted that adb can connect.
Change-Id: I75ac073b896719a95631729098ea469e410ae740
Diffstat (limited to 'TvProvision')
-rw-r--r-- | TvProvision/src/com/android/tv/provision/DefaultActivity.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/TvProvision/src/com/android/tv/provision/DefaultActivity.java b/TvProvision/src/com/android/tv/provision/DefaultActivity.java index 0a7debf..1ba7cec 100644 --- a/TvProvision/src/com/android/tv/provision/DefaultActivity.java +++ b/TvProvision/src/com/android/tv/provision/DefaultActivity.java @@ -21,6 +21,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; import android.os.Bundle; +import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; @@ -42,6 +43,10 @@ public class DefaultActivity extends Activity { } Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1); Settings.Secure.putInt(getContentResolver(), TV_USER_SETUP_COMPLETE, 1); + if (SystemProperties.get("ro.kernel.qemu").equals("1")) { + // Emulator-only: Enable USB debugging and adb + Settings.Global.putInt(getContentResolver(), Settings.Global.ADB_ENABLED, 1); + } // remove this activity from the package manager. PackageManager pm = getPackageManager(); |