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

Commit 4e34839a authored by Fan Zhang's avatar Fan Zhang
Browse files

Fix settings robotest

Change-Id: I0685b1f47ae286a4fdf78a57c21f7a656804754f
Fix: 63146944
Test: robotest
parent 1e561edb
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.hardware.input.InputManager;
import android.os.UserManager;
import android.provider.Settings;
@@ -191,10 +192,14 @@ public class LanguageAndInputSettingsTest {
    @Test
    public void testNonIndexableKeys_existInXmlLayout() {
        final Context context = spy(RuntimeEnvironment.application);
        final Resources res = spy(RuntimeEnvironment.application.getResources());
        //(InputManager) context.getSystemService(Context.INPUT_SERVICE);
        InputManager manager = mock(InputManager.class);
        when(manager.getInputDeviceIds()).thenReturn(new int[]{});
        doReturn(manager).when(context).getSystemService(Context.INPUT_SERVICE);
        doReturn(res).when(context).getResources();
        doReturn(false).when(res)
            .getBoolean(com.android.internal.R.bool.config_supportSystemNavigationKeys);
        final List<String> niks = LanguageAndInputSettings.SEARCH_INDEX_DATA_PROVIDER
                .getNonIndexableKeys(context);
        final int xmlId = (new LanguageAndInputSettings()).getPreferenceScreenResId();