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

Commit 3bc2df4e authored by Fan Zhang's avatar Fan Zhang Committed by android-build-merger
Browse files

Merge "Fix SettingsDrawerActivityTest on fugu." into oc-dev am: 940f6a99

am: bb6f8469

Change-Id: I74de73282d33260ea99e240fcf904c1ab39361dc
parents 24a2f01f bb6f8469
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ package com.android.settingslib.drawer;

import android.annotation.LayoutRes;
import android.annotation.Nullable;
import android.app.ActionBar;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -27,7 +28,6 @@ import android.content.pm.PackageManager;
import android.content.res.TypedArray;
import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.Settings;
import android.util.ArraySet;
import android.util.Log;
import android.view.LayoutInflater;
@@ -117,14 +117,6 @@ public class SettingsDrawerActivity extends Activity {
        super.onPause();
    }

    /**
     * Gets the name of the intent action of the default setting app. Used to launch setting app
     * when Settings Home is clicked.
     */
    public String getSettingAction() {
        return Settings.ACTION_SETTINGS;
    }

    public void addCategoryListener(CategoryListener listener) {
        mCategoryListeners.add(listener);
    }
@@ -142,7 +134,7 @@ public class SettingsDrawerActivity extends Activity {

    @Override
    public void setContentView(@LayoutRes int layoutResID) {
        final ViewGroup parent = (ViewGroup) findViewById(R.id.content_frame);
        final ViewGroup parent = findViewById(R.id.content_frame);
        if (parent != null) {
            parent.removeAllViews();
        }
@@ -159,11 +151,14 @@ public class SettingsDrawerActivity extends Activity {
        ((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
    }

    public void showMenuIcon() {
        getActionBar().setDisplayHomeAsUpEnabled(true);
    private void showMenuIcon() {
        final ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
        }
    }

    protected void onCategoriesChanged() {
    private void onCategoriesChanged() {
        final int N = mCategoryListeners.size();
        for (int i = 0; i < N; i++) {
            mCategoryListeners.get(i).onCategoriesChanged();
+6 −12
Original line number Diff line number Diff line
@@ -16,7 +16,12 @@

package com.android.settingslib.drawer;

import android.app.Activity;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;

import android.app.Instrumentation;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
@@ -24,23 +29,12 @@ import android.support.test.filters.SmallTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import com.android.settingslib.R;

import com.google.common.truth.Truth;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
import static com.google.common.truth.Truth.assertThat;

@RunWith(AndroidJUnit4.class)
@SmallTest
public class SettingsDrawerActivityTest {