diff options
author | Christopher Tate <ctate@google.com> | 2012-09-10 16:50:14 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2012-09-10 16:50:57 -0700 |
commit | c09cdce1b05075da808ae080b9905a14a3e1e627 (patch) | |
tree | 0ed7854c9d6c19e30d16fd4b4fdf652d301deb5e /core/tests/coretests | |
parent | 009ea5a04c38dd209b73d28cb867f05e63ec89cc (diff) | |
download | frameworks_base-c09cdce1b05075da808ae080b9905a14a3e1e627.zip frameworks_base-c09cdce1b05075da808ae080b9905a14a3e1e627.tar.gz frameworks_base-c09cdce1b05075da808ae080b9905a14a3e1e627.tar.bz2 |
Update airplane-mode manipulation for the new Settings namespace
Quick Settings and global actions (aka longpress-Power) toggles are
included in this CL. The Settings app manipulations are updated in
a different CL because that's a different git package.
Bug 7132230
Change-Id: I50838f5e8d7b25a750d2bcae90bf384b09816dbb
Diffstat (limited to 'core/tests/coretests')
-rw-r--r-- | core/tests/coretests/src/android/app/DownloadManagerBaseTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/tests/coretests/src/android/app/DownloadManagerBaseTest.java b/core/tests/coretests/src/android/app/DownloadManagerBaseTest.java index b2075ae..af2a944 100644 --- a/core/tests/coretests/src/android/app/DownloadManagerBaseTest.java +++ b/core/tests/coretests/src/android/app/DownloadManagerBaseTest.java @@ -29,6 +29,7 @@ import android.net.Uri; import android.net.wifi.WifiManager; import android.os.Environment; import android.os.ParcelFileDescriptor; +import android.os.UserHandle; import android.os.ParcelFileDescriptor.AutoCloseInputStream; import android.os.SystemClock; import android.provider.Settings; @@ -553,7 +554,7 @@ public class DownloadManagerBaseTest extends InstrumentationTestCase { int state = enable ? 1 : 0; // Change the system setting - Settings.System.putInt(mContext.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, + Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, state); String timeoutMessage = "Timed out waiting for airplane mode to be " + @@ -561,8 +562,8 @@ public class DownloadManagerBaseTest extends InstrumentationTestCase { // wait for airplane mode to change state int currentWaitTime = 0; - while (Settings.System.getInt(mContext.getContentResolver(), - Settings.System.AIRPLANE_MODE_ON, -1) != state) { + while (Settings.Global.getInt(mContext.getContentResolver(), + Settings.Global.AIRPLANE_MODE_ON, -1) != state) { timeoutWait(currentWaitTime, DEFAULT_WAIT_POLL_TIME, DEFAULT_MAX_WAIT_TIME, timeoutMessage); } @@ -570,7 +571,7 @@ public class DownloadManagerBaseTest extends InstrumentationTestCase { // Post the intent Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED); intent.putExtra("state", true); - mContext.sendBroadcast(intent); + mContext.sendBroadcastAsUser(intent, UserHandle.ALL); } /** |