summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-06-27 13:15:32 -0700
committerWinson Chung <winsonc@google.com>2011-07-01 10:47:07 -0700
commit9112ec3039dda4186c6f957981237c0691db2269 (patch)
tree684de37f923204e28db85f85b336b68d59dc58e9 /packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
parente2474bc711c5534ab20949206c54eb364d9a8ac5 (diff)
downloadframeworks_base-9112ec3039dda4186c6f957981237c0691db2269.zip
frameworks_base-9112ec3039dda4186c6f957981237c0691db2269.tar.gz
frameworks_base-9112ec3039dda4186c6f957981237c0691db2269.tar.bz2
Binding Pwr+VolDown to take screenshot.
Change-Id: I77b018538f6bc870f59df0b5336ba95f4582beec
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java')
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
new file mode 100644
index 0000000..35eaedf
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/TakeScreenshotService.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.screenshot;
+
+import android.app.Service;
+import android.app.AlertDialog;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.net.Uri;
+import android.hardware.usb.UsbAccessory;
+import android.hardware.usb.UsbManager;
+import android.os.Bundle;
+import android.os.IBinder;
+import android.util.Log;
+
+import com.android.internal.app.AlertActivity;
+import com.android.internal.app.AlertController;
+
+import com.android.systemui.R;
+
+public class TakeScreenshotService extends Service {
+ private static final String TAG = "TakeScreenshotService";
+
+ private static GlobalScreenshot mScreenshot;
+
+ @Override
+ public IBinder onBind(Intent intent) {
+ if (mScreenshot == null) {
+ mScreenshot = new GlobalScreenshot(this);
+ }
+ mScreenshot.takeScreenshot();
+ return null;
+ }
+}