Merge "DevicePolicyManager: Skip clearing APN before boot completed" into udc-dev am: 173ce5c44d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23120798

Change-Id: Ie051a216d1b1aedff45cf5a276f6c9faea49b2d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Rubin Xu
2023-05-11 11:57:51 +00:00
committed by Automerger Merge Worker

View File

@@ -446,7 +446,6 @@ import android.util.AtomicFile;
import android.util.DebugUtils;
import android.util.IndentingPrintWriter;
import android.util.IntArray;
import android.util.Log;
import android.util.Pair;
import android.util.Slog;
import android.util.SparseArray;
@@ -489,6 +488,7 @@ import com.android.server.LockGuard;
import com.android.server.PersistentDataBlockManagerInternal;
import com.android.server.SystemServerInitThreadPool;
import com.android.server.SystemService;
import com.android.server.SystemServiceManager;
import com.android.server.devicepolicy.ActiveAdmin.TrustAgentInfo;
import com.android.server.inputmethod.InputMethodManagerInternal;
import com.android.server.net.NetworkPolicyManagerInternal;
@@ -10071,6 +10071,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
if (!mHasTelephonyFeature) {
return;
}
if (!LocalServices.getService(SystemServiceManager.class).isBootCompleted()) {
Slogf.i(LOG_TAG, "Skip clearing managed profile Apn before boot completed");
// Cannot talk to APN content provider before system boots
// Ideally we should delay the cleanup post boot_completed, not just
// skipping it altogether.
return;
}
final List<ApnSetting> apns = getOverrideApnsUnchecked();
for (ApnSetting apn : apns) {
if (apn.getApnTypeBitmask() == ApnSetting.TYPE_ENTERPRISE) {