Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1ec220c authored by Tsu Chiang Chuang's avatar Tsu Chiang Chuang Committed by Android (Google) Code Review
Browse files

Merge "Change the way how airplane mode is set, since it has been moved to...

Merge "Change the way how airplane mode is set, since it has been moved to Settings.Global namespace. Also run as a system app, since only system apps can change airplane mode." into jb-mr1-dev
parents 6de76d21 35fae68c
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -25,4 +25,11 @@ LOCAL_SDK_VERSION := current

LOCAL_PACKAGE_NAME := DownloadManagerTestApp

ifneq ($(TARGET_BUILD_VARIANT),user)
# Need to run as system app to get access to Settings.
LOCAL_CERTIFICATE := platform
else
$(error "This test app will fail to run unless it is built in non-user mode.")
endif

include $(BUILD_PACKAGE)
+3 −1
Original line number Diff line number Diff line
@@ -14,7 +14,8 @@
     limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
       package="com.android.frameworks.downloadmanagertests">
       package="com.android.frameworks.downloadmanagertests"
       android:sharedUserId="android.uid.system">

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
@@ -22,6 +23,7 @@
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />

    <application android:label="DownloadManagerTestApp">
            <uses-library android:name="android.test.runner" />
+2 −2
Original line number Diff line number Diff line
@@ -262,7 +262,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 " +
@@ -271,7 +271,7 @@ 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) {
                Settings.Global.AIRPLANE_MODE_ON, -1) != state) {
            timeoutWait(currentWaitTime, DEFAULT_WAIT_POLL_TIME, DEFAULT_MAX_WAIT_TIME,
                    timeoutMessage);
        }