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

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

Merge "Move shell check to ShellCommand from system-service" into main

parents 44caa462 f51271e5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -850,7 +850,6 @@ public class OnDeviceIntelligenceManagerService extends SystemService {

    @RequiresPermission(Manifest.permission.USE_ON_DEVICE_INTELLIGENCE)
    public void resetTemporaryServices() {
        enforceShellOnly(Binder.getCallingUid(), "resetTemporaryServices");
        mContext.enforceCallingPermission(
                Manifest.permission.USE_ON_DEVICE_INTELLIGENCE, TAG);
        synchronized (mLock) {
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.ondeviceintelligence;

import android.annotation.NonNull;
import android.os.Binder;
import android.os.ShellCommand;

import java.io.PrintWriter;
@@ -78,6 +79,8 @@ final class OnDeviceIntelligenceShellCommand extends ShellCommand {

        if (getRemainingArgsCount() == 0 && intelligenceServiceName == null
                && inferenceServiceName == null) {
            OnDeviceIntelligenceManagerService.enforceShellOnly(Binder.getCallingUid(),
                    "resetTemporaryServices");
            mService.resetTemporaryServices();
            out.println("OnDeviceIntelligenceManagerService temporary reset. ");
            return 0;