android.os.ShellCallback Java Examples

The following examples show how to use android.os.ShellCallback. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DisplayManagerService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override // Binder call
public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    final long token = Binder.clearCallingIdentity();
    try {
        DisplayManagerShellCommand command = new DisplayManagerShellCommand(this);
        command.exec(this, in, out, err, args, callback, resultReceiver);
    } finally {
        Binder.restoreCallingIdentity(token);
    }
}
 
Example #2
Source File: WebViewUpdateService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new WebViewUpdateServiceShellCommand(this)).exec(
            this, in, out, err, args, callback, resultReceiver);
}
 
Example #3
Source File: PowerManagerService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new PowerManagerShellCommand(this)).exec(
            this, in, out, err, args, callback, resultReceiver);
}
 
Example #4
Source File: NetworkWatchlistService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
    if (!isCallerShell()) {
        Slog.w(TAG, "Only shell is allowed to call network watchlist shell commands");
        return;
    }
    (new NetworkWatchlistShellCommand(this, mContext)).exec(this, in, out, err, args, callback,
            resultReceiver);
}
 
Example #5
Source File: LockSettingsService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver)
        throws RemoteException {
    enforceShell();
    final long origId = Binder.clearCallingIdentity();
    try {
        (new LockSettingsShellCommand(mContext, new LockPatternUtils(mContext))).exec(
                this, in, out, err, args, callback, resultReceiver);
    } finally {
        Binder.restoreCallingIdentity(origId);
    }
}
 
Example #6
Source File: OverlayManagerService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void onShellCommand(@NonNull final FileDescriptor in,
        @NonNull final FileDescriptor out, @NonNull final FileDescriptor err,
        @NonNull final String[] args, @NonNull final ShellCallback callback,
        @NonNull final ResultReceiver resultReceiver) {
    (new OverlayManagerShellCommand(this)).exec(
            this, in, out, err, args, callback, resultReceiver);
}
 
Example #7
Source File: ShortcutService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {

    enforceShell();

    final long token = injectClearCallingIdentity();
    try {
        final int status = (new MyShellCommand()).exec(this, in, out, err, args, callback,
                resultReceiver);
        resultReceiver.send(status, null);
    } finally {
        injectRestoreCallingIdentity(token);
    }
}
 
Example #8
Source File: SettingsService.java    From Study_Android_Demo with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
    (new MyShellCommand(mProvider, false)).exec(
            this, in, out, err, args, callback, resultReceiver);
}
 
Example #9
Source File: ContentService.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new ContentShellCommand(this)).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #10
Source File: AppOpsService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new Shell(this, this)).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #11
Source File: DeviceStorageMonitorService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new Shell()).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #12
Source File: BatteryService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new Shell()).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #13
Source File: OtaDexoptService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
    (new OtaDexoptShellCommand(this)).exec(
            this, in, out, err, args, callback, resultReceiver);
}
 
Example #14
Source File: UserManagerService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new Shell()).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #15
Source File: ContentService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback,
        ResultReceiver resultReceiver) {
    (new ContentShellCommand(this)).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #16
Source File: SliceManagerService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
    new SliceShellCommand(this).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #17
Source File: DeviceIdleController.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override public void onShellCommand(FileDescriptor in, FileDescriptor out,
        FileDescriptor err, String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
    (new Shell()).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #18
Source File: UiModeManagerService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
    new Shell(mService).exec(mService, in, out, err, args, callback, resultReceiver);
}
 
Example #19
Source File: VibratorService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver)
        throws RemoteException {
    new VibratorShellCommand(this).exec(this, in, out, err, args, callback, resultReceiver);
}
 
Example #20
Source File: StatusBarManagerService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
    (new StatusBarShellCommand(this)).exec(
            this, in, out, err, args, callback, resultReceiver);
}
 
Example #21
Source File: JobSchedulerService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
        String[] args, ShellCallback callback, ResultReceiver resultReceiver) {
        (new JobSchedulerShellCommand(JobSchedulerService.this)).exec(
                this, in, out, err, args, callback, resultReceiver);
}