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

Remove legacy code belonged to Andrometa project. Split system user
feature is always turned off now.

Bug: 137101239
Test: build, sync and reboot
Change-Id: Ieb84a6e131383dcd263a5d9b29a49dc64d905fe0
This commit is contained in:
Yan Zhu
2021-01-12 12:23:43 -08:00
parent 6ac579fe44
commit 460c2cbc0f
6 changed files with 3 additions and 43 deletions

View File

@@ -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 {

View File

@@ -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() {

View File

@@ -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);
}
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);

View File

@@ -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);
}
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);

View File

@@ -430,11 +430,6 @@ public class WifiConfigController2Test {
super(parent, view, wifiEntry, mode, wifiManager);
}
@Override
boolean isSplitSystemUser() {
return false;
}
@Override
KeyStore getKeyStore() {
return mKeyStore;

View File

@@ -411,11 +411,6 @@ public class WifiConfigControllerTest {
super(parent, view, accessPoint, mode, wifiManager);
}
@Override
boolean isSplitSystemUser() {
return false;
}
@Override
KeyStore getKeyStore() { return mKeyStore; }
}