Loading tests/Compatibility/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -18,12 +18,12 @@ include $(CLEAR_VARS) # We only want this apk build for tests. LOCAL_MODULE_TAGS := tests LOCAL_JAVA_LIBRARIES := android.test.runner # Include all test java files. LOCAL_SRC_FILES := \ $(call all-java-files-under, src) LOCAL_SDK_VERSION := 8 LOCAL_PACKAGE_NAME := AppCompatibilityTest include $(BUILD_PACKAGE) Loading tests/Compatibility/AndroidManifest.xml +0 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,4 @@ android:name=".AppCompatibilityRunner" android:targetPackage="com.android.compatibilitytest" android:label="App Compability Test Runner" /> <uses-sdk android:minSdkVersion="8"></uses-sdk> </manifest> tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java +10 −2 Original line number Diff line number Diff line Loading @@ -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"); Loading Loading
tests/Compatibility/Android.mk +1 −1 Original line number Diff line number Diff line Loading @@ -18,12 +18,12 @@ include $(CLEAR_VARS) # We only want this apk build for tests. LOCAL_MODULE_TAGS := tests LOCAL_JAVA_LIBRARIES := android.test.runner # Include all test java files. LOCAL_SRC_FILES := \ $(call all-java-files-under, src) LOCAL_SDK_VERSION := 8 LOCAL_PACKAGE_NAME := AppCompatibilityTest include $(BUILD_PACKAGE) Loading
tests/Compatibility/AndroidManifest.xml +0 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,4 @@ android:name=".AppCompatibilityRunner" android:targetPackage="com.android.compatibilitytest" android:label="App Compability Test Runner" /> <uses-sdk android:minSdkVersion="8"></uses-sdk> </manifest>
tests/Compatibility/src/com/android/compatibilitytest/AppCompatibility.java +10 −2 Original line number Diff line number Diff line Loading @@ -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"); Loading