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

Commit 86f2b236 authored by Jordan Liu's avatar Jordan Liu
Browse files

Implement getAssets to fix crashing test

UiccCardApplicationTest crashes when run on aosp_walleye-userdebug.
Implementing getAssets with the default AssetManager (this is final and
unmockable) fixes the problem.

Bug: 29579544
Test: verify that UiccCardApplicationTest now passes
Change-Id: I6786ca44b7acef710710b539b97507204b904fe3
parent c5d3256e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.Cursor;
@@ -266,6 +267,11 @@ public class ContextFixture implements TestFixture<Context> {
            return 0;
        }

        @Override
        public AssetManager getAssets() {
            return mAssetManager;
        }

        @Override
        public Resources getResources() {
            return mResources;
@@ -524,6 +530,7 @@ public class ContextFixture implements TestFixture<Context> {
    private final CarrierConfigManager mCarrierConfigManager = mock(CarrierConfigManager.class);
    private final SubscriptionManager mSubscriptionManager = mock(SubscriptionManager.class);
    private final AlarmManager mAlarmManager = mock(AlarmManager.class);
    private final AssetManager mAssetManager = new AssetManager();
    private final ConnectivityManager mConnectivityManager = mock(ConnectivityManager.class);
    private final UsageStatsManager mUsageStatManager = null;
    private final WifiManager mWifiManager = mock(WifiManager.class);