summaryrefslogtreecommitdiffstats
path: root/tests/Compatibility/src
diff options
context:
space:
mode:
authorwsmlby <wsmlby@google.com>2014-09-18 13:33:18 -0700
committerwsmlby <wsmlby@google.com>2014-09-18 14:09:17 -0700
commite87cc9a2f29567747c0ea92756f2b579550016c7 (patch)
tree26291b31e4575223afb2b83b8ae32d9036592880 /tests/Compatibility/src
parentb5dc5f6b555dd747bb4bc51bf5fe64e8a4aa4093 (diff)
downloadframeworks_base-e87cc9a2f29567747c0ea92756f2b579550016c7.zip
frameworks_base-e87cc9a2f29567747c0ea92756f2b579550016c7.tar.gz
frameworks_base-e87cc9a2f29567747c0ea92756f2b579550016c7.tar.bz2
Add leanback support to AppCompatiblityTest
Change-Id: Ia9da14b8551c4ec5834a047f0792a5a213a3ac04
Diffstat (limited to 'tests/Compatibility/src')
-rw-r--r--tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
index a2e9117..5794b2b 100644
--- a/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
+++ b/tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java
@@ -147,11 +147,19 @@ public class AppCompatibility extends InstrumentationTestCase {
* during the app launch.
*/
private ProcessErrorStateInfo launchActivity(String packageName) {
+ // the recommended way to see if this is a tv or not.
+ boolean isleanback = !mPackageManager.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN)
+ && !mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY);
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory(Intent.CATEGORY_HOME);
homeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
- Intent intent = mPackageManager.getLaunchIntentForPackage(packageName);
+ Intent intent;
+ if (isleanback) {
+ Log.d(TAG, "Leanback and relax!");
+ intent = mPackageManager.getLeanbackLaunchIntentForPackage(packageName);
+ } else {
+ intent = mPackageManager.getLaunchIntentForPackage(packageName);
+ }
// Skip if the apk does not have a launch intent.
if (intent == null) {
Log.d(TAG, "Skipping " + packageName + "; missing launch intent");