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

Commit b4c9a8f6 authored by Brett Chabot's avatar Brett Chabot Committed by Android (Google) Code Review
Browse files

Merge "Fix imf tests." into froyo

parents bb129dc5 e9d0b296
Loading
Loading
Loading
Loading
+17 −13
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.imftest.samples;
import android.app.Activity;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.SystemClock;
import android.test.InstrumentationTestCase;
@@ -57,10 +58,13 @@ public abstract class ImfBaseTestCase<T extends Activity> extends Instrumentatio
    public void setUp() throws Exception {
        super.setUp();
        final String packageName = getInstrumentation().getTargetContext().getPackageName();
        mTargetActivity = launchActivity(packageName, mTargetActivityClass, null);
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
        mTargetActivity = launchActivityWithIntent(packageName, mTargetActivityClass, intent);
        // expect ime to auto pop up if device has no hard keyboard
        mExpectAutoPop = mTargetActivity.getResources().getConfiguration().hardKeyboardHidden == 
            Configuration.HARDKEYBOARDHIDDEN_YES;
        int keyboardType = mTargetActivity.getResources().getConfiguration().keyboard;
        mExpectAutoPop = (keyboardType  == Configuration.KEYBOARD_NOKEYS ||
                keyboardType == Configuration.KEYBOARD_UNDEFINED);

        mImm = InputMethodManager.getInstance(mTargetActivity);