File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
tests/StatusBar/src/com/android/statusbartest Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ public Dialog(Context context) {
136136 public Dialog (Context context , int theme ) {
137137 mContext = new ContextThemeWrapper (
138138 context , theme == 0 ? com .android .internal .R .style .Theme_Dialog : theme );
139- mWindowManager = (WindowManager )context .getSystemService ("window" );
139+ mWindowManager = (WindowManager )context .getSystemService (Context . WINDOW_SERVICE );
140140 Window w = PolicyManager .makeNewWindow (mContext );
141141 mWindow = w ;
142142 w .setCallback (this );
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ public MediaController(Context context) {
123123 }
124124
125125 private void initFloatingWindow () {
126- mWindowManager = (WindowManager )mContext .getSystemService ("window" );
126+ mWindowManager = (WindowManager )mContext .getSystemService (Context . WINDOW_SERVICE );
127127 mWindow = PolicyManager .makeNewWindow (mContext );
128128 mWindow .setWindowManager (mWindowManager , null , null );
129129 mWindow .requestFeature (Window .FEATURE_NO_TITLE );
Original file line number Diff line number Diff line change 2121import android .widget .ArrayAdapter ;
2222import android .view .View ;
2323import android .widget .ListView ;
24+ import android .content .Context ;
2425import android .content .ContentResolver ;
2526import android .content .Intent ;
2627import android .app .Notification ;
@@ -60,7 +61,7 @@ protected Test[] tests() {
6061 private Test [] mTests = new Test [] {
6162 new Test ("Off and sound" ) {
6263 public void run () {
63- PowerManager pm = (PowerManager )NotificationTestList .this .getSystemService ("power" );
64+ PowerManager pm = (PowerManager )NotificationTestList .this .getSystemService (Context . POWER_SERVICE );
6465 PowerManager .WakeLock wl =
6566 pm .newWakeLock (PowerManager .PARTIAL_WAKE_LOCK , "sound" );
6667 wl .acquire ();
@@ -549,7 +550,7 @@ public void run() {
549550 public void run ()
550551 {
551552 PowerManager .WakeLock wl
552- = ((PowerManager )NotificationTestList .this .getSystemService ("power" ))
553+ = ((PowerManager )NotificationTestList .this .getSystemService (Context . POWER_SERVICE ))
553554 .newWakeLock (PowerManager .PARTIAL_WAKE_LOCK , "crasher" );
554555 wl .acquire ();
555556 mHandler .postDelayed (new Runnable () {
You can’t perform that action at this time.
0 commit comments