merge from open-source master

Change-Id: I8333e295ba6b6ed8e7658ecf3fbf1ebea3537aeb
This commit is contained in:
The Android Open Source Project
2010-06-02 08:54:47 -07:00
3 changed files with 5 additions and 4 deletions

View File

@@ -138,7 +138,7 @@ public class Dialog implements DialogInterface, Window.Callback,
public Dialog(Context context, int theme) {
mContext = new ContextThemeWrapper(
context, theme == 0 ? com.android.internal.R.style.Theme_Dialog : theme);
mWindowManager = (WindowManager)context.getSystemService("window");
mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
Window w = PolicyManager.makeNewWindow(mContext);
mWindow = w;
w.setCallback(this);

View File

@@ -123,7 +123,7 @@ public class MediaController extends FrameLayout {
}
private void initFloatingWindow() {
mWindowManager = (WindowManager)mContext.getSystemService("window");
mWindowManager = (WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
mWindow = PolicyManager.makeNewWindow(mContext);
mWindow.setWindowManager(mWindowManager, null, null);
mWindow.requestFeature(Window.FEATURE_NO_TITLE);

View File

@@ -21,6 +21,7 @@ import android.app.PendingIntent;
import android.widget.ArrayAdapter;
import android.view.View;
import android.widget.ListView;
import android.content.Context;
import android.content.ContentResolver;
import android.content.Intent;
import android.app.Notification;
@@ -60,7 +61,7 @@ public class NotificationTestList extends TestActivity
private Test[] mTests = new Test[] {
new Test("Off and sound") {
public void run() {
PowerManager pm = (PowerManager)NotificationTestList.this.getSystemService("power");
PowerManager pm = (PowerManager)NotificationTestList.this.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl =
pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "sound");
wl.acquire();
@@ -599,7 +600,7 @@ public class NotificationTestList extends TestActivity
public void run()
{
PowerManager.WakeLock wl
= ((PowerManager)NotificationTestList.this.getSystemService("power"))
= ((PowerManager)NotificationTestList.this.getSystemService(Context.POWER_SERVICE))
.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "crasher");
wl.acquire();
mHandler.postDelayed(new Runnable() {