blob: 6ed099b183163c33727fda8288df87543c1db9a9 [file] [log] [blame]
San Mehatf1b736b2009-10-10 17:22:08 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _COMMANDLISTENER_H__
18#define _COMMANDLISTENER_H__
19
20#include <sysutils/FrameworkListener.h>
Jeff Sharkey36801cc2015-03-13 16:09:20 -070021#include <utils/Errors.h>
San Mehatf1b736b2009-10-10 17:22:08 -070022#include "VoldCommand.h"
23
24class CommandListener : public FrameworkListener {
25public:
26 CommandListener();
27 virtual ~CommandListener() {}
28
29private:
San Mehatd9a4e352010-03-12 13:32:47 -080030 static void dumpArgs(int argc, char **argv, int argObscure);
Jeff Sharkey36801cc2015-03-13 16:09:20 -070031 static int sendGenericOkFail(SocketClient *cli, int cond);
San Mehatd9a4e352010-03-12 13:32:47 -080032
33 class DumpCmd : public VoldCommand {
34 public:
35 DumpCmd();
36 virtual ~DumpCmd() {}
37 int runCommand(SocketClient *c, int argc, char ** argv);
38 };
San Mehatf1b736b2009-10-10 17:22:08 -070039
San Mehateba65e92010-01-29 05:15:16 -080040 class VolumeCmd : public VoldCommand {
San Mehatf1b736b2009-10-10 17:22:08 -070041 public:
San Mehateba65e92010-01-29 05:15:16 -080042 VolumeCmd();
43 virtual ~VolumeCmd() {}
San Mehatf1b736b2009-10-10 17:22:08 -070044 int runCommand(SocketClient *c, int argc, char ** argv);
45 };
46
San Mehateba65e92010-01-29 05:15:16 -080047 class AsecCmd : public VoldCommand {
San Mehatf1b736b2009-10-10 17:22:08 -070048 public:
San Mehateba65e92010-01-29 05:15:16 -080049 AsecCmd();
50 virtual ~AsecCmd() {}
San Mehata19b2502010-01-06 10:33:53 -080051 int runCommand(SocketClient *c, int argc, char ** argv);
Kenny Root344ca102012-04-03 17:23:01 -070052 private:
53 void listAsecsInDirectory(SocketClient *c, const char *directory);
San Mehata19b2502010-01-06 10:33:53 -080054 };
55
Kenny Root508c0e12010-07-12 09:59:49 -070056 class ObbCmd : public VoldCommand {
Kenny Rootfb7c4d52010-06-30 18:48:41 -070057 public:
Kenny Root508c0e12010-07-12 09:59:49 -070058 ObbCmd();
59 virtual ~ObbCmd() {}
Kenny Rootfb7c4d52010-06-30 18:48:41 -070060 int runCommand(SocketClient *c, int argc, char ** argv);
61 };
62
San Mehat586536c2010-02-16 17:12:00 -080063 class StorageCmd : public VoldCommand {
64 public:
65 StorageCmd();
66 virtual ~StorageCmd() {}
67 int runCommand(SocketClient *c, int argc, char ** argv);
68 };
San Mehat2350c442010-03-02 13:16:50 -080069
Ken Sumrallb87937c2013-03-19 21:46:39 -070070 class FstrimCmd : public VoldCommand {
71 public:
72 FstrimCmd();
73 virtual ~FstrimCmd() {}
74 int runCommand(SocketClient *c, int argc, char ** argv);
75 };
San Mehatf1b736b2009-10-10 17:22:08 -070076};
77
78#endif