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

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

Merge "Remove unused services code" into main

parents 22d41f48 3d3366d5
Loading
Loading
Loading
Loading
+0 −13
Original line number Original line Diff line number Diff line
@@ -31,7 +31,6 @@ import android.app.ambientcontext.IAmbientContextManager;
import android.app.ambientcontext.IAmbientContextObserver;
import android.app.ambientcontext.IAmbientContextObserver;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Context;
import android.content.Context;
import android.content.pm.PackageManagerInternal;
import android.os.RemoteCallback;
import android.os.RemoteCallback;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.ResultReceiver;
import android.os.ResultReceiver;
@@ -43,12 +42,10 @@ import android.util.Slog;


import com.android.internal.R;
import com.android.internal.R;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.DumpUtils;
import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.SystemService;
import com.android.server.ambientcontext.AmbientContextManagerPerUserService.ServiceType;
import com.android.server.ambientcontext.AmbientContextManagerPerUserService.ServiceType;
import com.android.server.infra.AbstractMasterSystemService;
import com.android.server.infra.AbstractMasterSystemService;
import com.android.server.infra.FrameworkResourcesServiceNameResolver;
import com.android.server.infra.FrameworkResourcesServiceNameResolver;
import com.android.server.pm.KnownPackages;


import com.google.android.collect.Sets;
import com.google.android.collect.Sets;


@@ -299,16 +296,6 @@ public class AmbientContextManagerService extends
        return MAX_TEMPORARY_SERVICE_DURATION_MS;
        return MAX_TEMPORARY_SERVICE_DURATION_MS;
    }
    }


    /** Returns {@code true} if the detection service is configured on this device. */
    public static boolean isDetectionServiceConfigured() {
        final PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class);
        final String[] packageNames = pmi.getKnownPackageNames(
                KnownPackages.PACKAGE_AMBIENT_CONTEXT_DETECTION, UserHandle.USER_SYSTEM);
        boolean isServiceConfigured = (packageNames.length != 0);
        Slog.i(TAG, "Detection service configured: " + isServiceConfigured);
        return isServiceConfigured;
    }

    /**
    /**
     * Send request to the remote AmbientContextDetectionService impl to start detecting the
     * Send request to the remote AmbientContextDetectionService impl to start detecting the
     * specified events. Intended for use by shell command for testing.
     * specified events. Intended for use by shell command for testing.
+0 −10
Original line number Original line Diff line number Diff line
@@ -408,16 +408,6 @@ public class Installer extends SystemService {
        }
        }
    }
    }


    public void restoreconAppData(String uuid, String packageName, int userId, int flags, int appId,
            String seInfo) throws InstallerException {
        if (!checkBeforeRemote()) return;
        try {
            mInstalld.restoreconAppData(uuid, packageName, userId, flags, appId, seInfo);
        } catch (Exception e) {
            throw InstallerException.from(e);
        }
    }

    public void migrateAppData(String uuid, String packageName, int userId, int flags)
    public void migrateAppData(String uuid, String packageName, int userId, int flags)
            throws InstallerException {
            throws InstallerException {
        if (!checkBeforeRemote()) return;
        if (!checkBeforeRemote()) return;
+0 −4
Original line number Original line Diff line number Diff line
@@ -218,10 +218,6 @@ public class UriGrantsManagerService extends IUriGrantsManager.Stub implements
                mService.mMetricsHelper.registerPuller();
                mService.mMetricsHelper.registerPuller();
            }
            }
        }
        }

        public UriGrantsManagerService getService() {
            return mService;
        }
    }
    }


    @VisibleForTesting
    @VisibleForTesting
+0 −13
Original line number Original line Diff line number Diff line
@@ -33,7 +33,6 @@ import android.app.wearable.WearableSensingManager;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.content.pm.PackageManagerInternal;
import android.os.Binder;
import android.os.Binder;
import android.os.Build;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
@@ -50,11 +49,9 @@ import android.util.Slog;


import com.android.internal.R;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.SystemService;
import com.android.server.infra.AbstractMasterSystemService;
import com.android.server.infra.AbstractMasterSystemService;
import com.android.server.infra.FrameworkResourcesServiceNameResolver;
import com.android.server.infra.FrameworkResourcesServiceNameResolver;
import com.android.server.pm.KnownPackages;
import com.android.server.utils.quota.MultiRateLimiter;
import com.android.server.utils.quota.MultiRateLimiter;


import java.io.FileDescriptor;
import java.io.FileDescriptor;
@@ -196,16 +193,6 @@ public class WearableSensingManagerService extends
        return MAX_TEMPORARY_SERVICE_DURATION_MS;
        return MAX_TEMPORARY_SERVICE_DURATION_MS;
    }
    }


    /** Returns {@code true} if the detection service is configured on this device. */
    public static boolean isDetectionServiceConfigured() {
        final PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class);
        final String[] packageNames = pmi.getKnownPackageNames(
                KnownPackages.PACKAGE_WEARABLE_SENSING, UserHandle.USER_SYSTEM);
        boolean isServiceConfigured = (packageNames.length != 0);
        Slog.i(TAG, "Wearable sensing service configured: " + isServiceConfigured);
        return isServiceConfigured;
    }

    /**
    /**
     * Returns the AmbientContextManagerPerUserService component for this user.
     * Returns the AmbientContextManagerPerUserService component for this user.
     */
     */