am 1bd7597b: merge from open-source master

Merge commit '1bd7597b8cdaf39d1183077c463cb30596eb31b0' into kraken

* commit '1bd7597b8cdaf39d1183077c463cb30596eb31b0':
  Replaced raw string arguments for Context.getSystemService() with final Context variables
This commit is contained in:
The Android Open Source Project
2010-06-02 09:03:04 -07:00
committed by Android Git Automerger
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) { public Dialog(Context context, int theme) {
mContext = new ContextThemeWrapper( mContext = new ContextThemeWrapper(
context, theme == 0 ? com.android.internal.R.style.Theme_Dialog : theme); 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); Window w = PolicyManager.makeNewWindow(mContext);
mWindow = w; mWindow = w;
w.setCallback(this); w.setCallback(this);

View File

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

View File

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