blob: da8654cdc3f7572ef85f85d64f1e6bcad3d75a16 [file] [log] [blame]
Joe Onoratof3c3c4f2010-10-21 11:09:02 -04001/*
2 * Copyright (C) 2010 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
17package com.android.systemui;
18
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040019import android.app.Service;
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040020import android.content.Intent;
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040021import android.os.IBinder;
John Spurlockb0e49fc2013-06-12 15:50:50 -040022
23import java.io.FileDescriptor;
24import java.io.PrintWriter;
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040025
26public class SystemUIService extends Service {
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040027
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040028 @Override
29 public IBinder onBind(Intent intent) {
30 return null;
31 }
32
33 @Override
34 protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
Jorim Jaggicff0acb2014-03-31 16:35:15 +020035 SystemUI[] services = ((SystemUIApplication) getApplication()).getServices();
Joe Onorato10523b4d2010-10-25 10:42:46 -070036 if (args == null || args.length == 0) {
Jorim Jaggicff0acb2014-03-31 16:35:15 +020037 for (SystemUI ui: services) {
Joe Onorato10523b4d2010-10-25 10:42:46 -070038 pw.println("dumping service: " + ui.getClass().getName());
39 ui.dump(fd, pw, args);
40 }
41 } else {
42 String svc = args[0];
Jorim Jaggicff0acb2014-03-31 16:35:15 +020043 for (SystemUI ui: services) {
Joe Onorato10523b4d2010-10-25 10:42:46 -070044 String name = ui.getClass().getName();
45 if (name.endsWith(svc)) {
46 ui.dump(fd, pw, args);
47 }
48 }
Joe Onoratof3c3c4f2010-10-21 11:09:02 -040049 }
50 }
51}
52