Merge "Fix SettingsDrawerActivityTest on fugu." into oc-dev
am: 940f6a9962
Change-Id: I6346e51b77e03eca1c7496ce9fa3ed41c7de2a04
This commit is contained in:
@@ -17,6 +17,7 @@ package com.android.settingslib.drawer;
|
|||||||
|
|
||||||
import android.annotation.LayoutRes;
|
import android.annotation.LayoutRes;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.app.ActionBar;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
@@ -27,7 +28,6 @@ import android.content.pm.PackageManager;
|
|||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -117,14 +117,6 @@ public class SettingsDrawerActivity extends Activity {
|
|||||||
super.onPause();
|
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) {
|
public void addCategoryListener(CategoryListener listener) {
|
||||||
mCategoryListeners.add(listener);
|
mCategoryListeners.add(listener);
|
||||||
}
|
}
|
||||||
@@ -142,7 +134,7 @@ public class SettingsDrawerActivity extends Activity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContentView(@LayoutRes int layoutResID) {
|
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) {
|
if (parent != null) {
|
||||||
parent.removeAllViews();
|
parent.removeAllViews();
|
||||||
}
|
}
|
||||||
@@ -159,11 +151,14 @@ public class SettingsDrawerActivity extends Activity {
|
|||||||
((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
|
((ViewGroup) findViewById(R.id.content_frame)).addView(view, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showMenuIcon() {
|
private void showMenuIcon() {
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
final ActionBar actionBar = getActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onCategoriesChanged() {
|
private void onCategoriesChanged() {
|
||||||
final int N = mCategoryListeners.size();
|
final int N = mCategoryListeners.size();
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
mCategoryListeners.get(i).onCategoriesChanged();
|
mCategoryListeners.get(i).onCategoriesChanged();
|
||||||
|
|||||||
@@ -16,7 +16,12 @@
|
|||||||
|
|
||||||
package com.android.settingslib.drawer;
|
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.app.Instrumentation;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.test.InstrumentationRegistry;
|
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.rule.ActivityTestRule;
|
||||||
import android.support.test.runner.AndroidJUnit4;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import com.android.settingslib.R;
|
|
||||||
|
|
||||||
import com.google.common.truth.Truth;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.MockitoAnnotations;
|
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)
|
@RunWith(AndroidJUnit4.class)
|
||||||
@SmallTest
|
@SmallTest
|
||||||
public class SettingsDrawerActivityTest {
|
public class SettingsDrawerActivityTest {
|
||||||
|
|||||||
Reference in New Issue
Block a user