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

Commit 89a4392b authored by Harshit Mahajan's avatar Harshit Mahajan Committed by Automerger Merge Worker
Browse files

Merge "Refactoring recovery related code" into main am: c41f52c3 am:...

Merge "Refactoring recovery related code" into main am: c41f52c3 am: aa32ee64 am: 657c22c2 am: 774f2361

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



Change-Id: Ie8ef995979ea9af9c8ae2f8f30eb08c7185a1aa6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents cc3fc75c 774f2361
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ public abstract class ExplicitHealthCheckService extends Service {
     */
    @NonNull public abstract List<String> onGetRequestedPackages();

    private final Handler mHandler = new Handler(Looper.getMainLooper(), null, true);
    private final Handler mHandler = Handler.createAsync(Looper.getMainLooper());
    @Nullable private RemoteCallback mCallback;

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ class ExplicitHealthCheckController {
            };

            mContext.bindServiceAsUser(intent, mConnection,
                    Context.BIND_AUTO_CREATE, UserHandle.of(UserHandle.USER_SYSTEM));
                    Context.BIND_AUTO_CREATE, UserHandle.SYSTEM);
            Slog.i(TAG, "Explicit health check service is bound");
        }
    }
+5 −3
Original line number Diff line number Diff line
@@ -514,7 +514,8 @@ public class RescueParty {
        Exception res = null;
        final ContentResolver resolver = context.getContentResolver();
        try {
            Settings.Global.resetToDefaultsAsUser(resolver, null, mode, UserHandle.USER_SYSTEM);
            Settings.Global.resetToDefaultsAsUser(resolver, null, mode,
                UserHandle.SYSTEM.getIdentifier());
        } catch (Exception e) {
            res = new RuntimeException("Failed to reset global settings", e);
        }
@@ -771,12 +772,13 @@ public class RescueParty {
    }

    private static int[] getAllUserIds() {
        int[] userIds = { UserHandle.USER_SYSTEM };
        int systemUserId = UserHandle.SYSTEM.getIdentifier();
        int[] userIds = { systemUserId };
        try {
            for (File file : FileUtils.listFilesOrEmpty(Environment.getDataSystemDeDirectory())) {
                try {
                    final int userId = Integer.parseInt(file.getName());
                    if (userId != UserHandle.USER_SYSTEM) {
                    if (userId != systemUserId) {
                        userIds = ArrayUtils.appendInt(userIds, userId);
                    }
                } catch (NumberFormatException ignored) {