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

Commit 16f0d131 authored by Sunny Shao's avatar Sunny Shao
Browse files

Fixed mUserId_shouldDeriveUidFromMainCaller test case fail

- getApplicationContext() return null in some test cases.
- Add null checking to avoid the NPE failed.

Fixes: 263542897
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.applications
Change-Id: I374b5bbf8911bd6d4eb992e0fa7b1a67c3d16a91
parent d308b891
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -43,7 +43,11 @@ public class SettingsApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ElapsedTimeUtils.assignSuwFinishedTimeStamp(this.getApplicationContext());

        // Add null checking to avoid test case failed.
        if (getApplicationContext() != null) {
            ElapsedTimeUtils.assignSuwFinishedTimeStamp(getApplicationContext());
        }

        // Set Spa environment.
        setSpaEnvironment();