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

Commit f0568174 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Assert and verify setting system property in UserManagerServiceTest."

parents b4269968 5a8660b9
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.pm;
import static android.os.UserManager.DISALLOW_USER_SWITCH;

import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;

import android.app.ActivityManager;
import android.app.PropertyInvalidatedCache;
@@ -28,6 +29,7 @@ import android.os.Bundle;
import android.os.FileUtils;
import android.os.Looper;
import android.os.Parcelable;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.platform.test.annotations.Postsubmit;
@@ -307,8 +309,10 @@ public class UserManagerServiceTest {

    private static String setSystemProperty(String name, String value) throws Exception {
        final String oldValue = runShellCommand("getprop " + name);
        assertThat(runShellCommand("setprop " + name + " " + value))
                .isEqualTo("");
        assertWithMessage("can not set system property")
                .that(runShellCommand("setprop " + name + " " + value)).isEqualTo("");
        assertWithMessage("failed to set system property")
                .that(SystemProperties.get(name)).isEqualTo(value);
        return oldValue;
    }