Merge changes I4ae01109,Ib45289c3 into oc-dev
* changes: Remove shadow below app info header. Fix ANR in installed app details.
This commit is contained in:
committed by
Android (Google) Code Review
commit
eda3e8c3d9
@@ -112,9 +112,4 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<!-- Drop shadow -->
|
|
||||||
<View android:layout_width="match_parent"
|
|
||||||
android:layout_height="5dp"
|
|
||||||
android:background="@drawable/action_bar_dropshadow"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@@ -454,6 +454,10 @@ public class InstalledAppDetails extends AppInfoBase
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPackageSizeChanged(String packageName) {
|
public void onPackageSizeChanged(String packageName) {
|
||||||
|
if (!TextUtils.equals(packageName, mPackageName)) {
|
||||||
|
Log.d(LOG_TAG, "Package change irrelevant, skipping");
|
||||||
|
return;
|
||||||
|
}
|
||||||
refreshUi();
|
refreshUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,7 +18,6 @@ package com.android.settings.applications;
|
|||||||
|
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import static org.mockito.Matchers.any;
|
import static org.mockito.Matchers.any;
|
||||||
import static org.mockito.Matchers.anyString;
|
import static org.mockito.Matchers.anyString;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
@@ -69,6 +68,9 @@ import org.robolectric.util.ReflectionHelpers;
|
|||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||||
public final class InstalledAppDetailsTest {
|
public final class InstalledAppDetailsTest {
|
||||||
|
|
||||||
|
private static final String PACKAGE_NAME = "test_package_name";
|
||||||
|
|
||||||
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
@Mock
|
@Mock
|
||||||
@@ -181,6 +183,24 @@ public final class InstalledAppDetailsTest {
|
|||||||
verify(mActivity, never()).finishAndRemoveTask();
|
verify(mActivity, never()).finishAndRemoveTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void packageSizeChange_isOtherPackage_shouldNotRefreshUi() {
|
||||||
|
ReflectionHelpers.setField(mAppDetail, "mPackageName", PACKAGE_NAME);
|
||||||
|
mAppDetail.onPackageSizeChanged("Not_" + PACKAGE_NAME);
|
||||||
|
|
||||||
|
verify(mAppDetail, never()).refreshUi();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void packageSizeChange_isOwnPackage_shouldRefreshUi() {
|
||||||
|
doReturn(Boolean.TRUE).when(mAppDetail).refreshUi();
|
||||||
|
ReflectionHelpers.setField(mAppDetail, "mPackageName", PACKAGE_NAME);
|
||||||
|
|
||||||
|
mAppDetail.onPackageSizeChanged(PACKAGE_NAME);
|
||||||
|
|
||||||
|
verify(mAppDetail).refreshUi();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void launchPowerUsageDetailFragment_shouldNotCrash() {
|
public void launchPowerUsageDetailFragment_shouldNotCrash() {
|
||||||
mAppDetail.mBatteryPreference = mBatteryPreference;
|
mAppDetail.mBatteryPreference = mBatteryPreference;
|
||||||
|
Reference in New Issue
Block a user