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

Commit 11cbb5f6 authored by Yan Zhu's avatar Yan Zhu Committed by Android (Google) Code Review
Browse files

Merge "Clean up split system user code in packages/apps/Settings/"

parents fd401c01 460c2cbc
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.SystemClock;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
import android.util.Log;
@@ -166,12 +165,6 @@ public class FallbackHome extends Activity {
                    .addCategory(Intent.CATEGORY_HOME);
            final ResolveInfo homeInfo = getPackageManager().resolveActivity(homeIntent, 0);
            if (Objects.equals(getPackageName(), homeInfo.activityInfo.packageName)) {
                if (UserManager.isSplitSystemUser()
                        && UserHandle.myUserId() == UserHandle.USER_SYSTEM) {
                    // This avoids the situation where the system user has no home activity after
                    // SUW and this activity continues to throw out warnings. See b/28870689.
                    return;
                }
                Log.d(TAG, "User unlocked but no home; let's hope someone enables one soon?");
                mHandler.sendEmptyMessageDelayed(0, 500);
            } else {
+1 −2
Original line number Diff line number Diff line
@@ -613,8 +613,7 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
    /** Returns whether there is only one user on this device, not including the system-only user */
    private boolean isSingleUser() {
        final int userCount = mUserManager.getUserCount();
        return userCount == 1
                || (mUserManager.isSplitSystemUser() && userCount == 2);
        return userCount == 1;
    }

    private final BroadcastReceiver mCheckKillProcessesReceiver = new BroadcastReceiver() {
+1 −12
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import android.net.wifi.WifiEnterpriseConfig.Phase2;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.IBinder;
import android.os.UserManager;
import android.security.Credentials;
import android.security.KeyStore;
import android.telephony.SubscriptionInfo;
@@ -443,10 +442,7 @@ public class WifiConfigController implements TextWatcher,

            mSsidScanButton.setVisibility(View.GONE);
        }

        if (!isSplitSystemUser()) {
        mSharedCheckBox.setVisibility(View.GONE);
        }

        mConfigUi.setCancelButton(res.getString(R.string.wifi_cancel));
        if (mConfigUi.getSubmitButton() != null) {
@@ -459,13 +455,6 @@ public class WifiConfigController implements TextWatcher,
        }
    }

    @VisibleForTesting
    boolean isSplitSystemUser() {
        final UserManager userManager =
                (UserManager) mContext.getSystemService(Context.USER_SERVICE);
        return userManager.isSplitSystemUser();
    }

    private void addRow(ViewGroup group, int name, String value) {
        View row = mConfigUi.getLayoutInflater().inflate(R.layout.wifi_dialog_row, group, false);
        ((TextView) row.findViewById(R.id.name)).setText(name);
+1 −12
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.net.wifi.WifiEnterpriseConfig.Eap;
import android.net.wifi.WifiEnterpriseConfig.Phase2;
import android.net.wifi.WifiManager;
import android.os.IBinder;
import android.os.UserManager;
import android.security.Credentials;
import android.security.KeyStore;
import android.telephony.SubscriptionInfo;
@@ -408,10 +407,7 @@ public class WifiConfigController2 implements TextWatcher,

            mSsidScanButton.setVisibility(View.GONE);
        }

        if (!isSplitSystemUser()) {
        mSharedCheckBox.setVisibility(View.GONE);
        }

        mConfigUi.setCancelButton(res.getString(R.string.wifi_cancel));
        if (mConfigUi.getSubmitButton() != null) {
@@ -422,13 +418,6 @@ public class WifiConfigController2 implements TextWatcher,
        mView.findViewById(R.id.l_wifidialog).requestFocus();
    }

    @VisibleForTesting
    boolean isSplitSystemUser() {
        final UserManager userManager =
                (UserManager) mContext.getSystemService(Context.USER_SERVICE);
        return userManager.isSplitSystemUser();
    }

    private void addRow(ViewGroup group, int name, String value) {
        View row = mConfigUi.getLayoutInflater().inflate(R.layout.wifi_dialog_row, group, false);
        ((TextView) row.findViewById(R.id.name)).setText(name);
+0 −5
Original line number Diff line number Diff line
@@ -430,11 +430,6 @@ public class WifiConfigController2Test {
            super(parent, view, wifiEntry, mode, wifiManager);
        }

        @Override
        boolean isSplitSystemUser() {
            return false;
        }

        @Override
        KeyStore getKeyStore() {
            return mKeyStore;
Loading