aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorMatt Garnes <matt@cyngn.com>2015-07-14 16:29:56 -0700
committerMatt Garnes <matt@cyngn.com>2015-08-06 11:35:00 -0700
commit0cdb1d513c70a794db0e29696ef620c573aa96ea (patch)
tree3d429fc60c4f88be649164c4367850923fa25eec /tests/src
parent5b61a21f7f724de000980d3dfe36f0ec3b6485a1 (diff)
downloadvendor_cmsdk-0cdb1d513c70a794db0e29696ef620c573aa96ea.zip
vendor_cmsdk-0cdb1d513c70a794db0e29696ef620c573aa96ea.tar.gz
vendor_cmsdk-0cdb1d513c70a794db0e29696ef620c573aa96ea.tar.bz2
Add SettingsManager.
Add new APIs for changing a subset of system settings. Protected by cyanogenmod.permission.MODIFY_NETWORK_SETTINGS: - Add ability to toggle airplane mode on/off. - Add ability to toggle mobile data on/off. Protected by android.permission.REBOOT: - Add ability to shutdown or reboot the device. Change-Id: I5e943be11260c58afa664f1702c0ecb4413528fe
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/org/cyanogenmod/tests/settings/CMSettingsManagerTest.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/src/org/cyanogenmod/tests/settings/CMSettingsManagerTest.java b/tests/src/org/cyanogenmod/tests/settings/CMSettingsManagerTest.java
new file mode 100644
index 0000000..adbf459
--- /dev/null
+++ b/tests/src/org/cyanogenmod/tests/settings/CMSettingsManagerTest.java
@@ -0,0 +1,54 @@
+package org.cyanogenmod.tests.settings;
+
+import org.cyanogenmod.tests.TestActivity;
+import cyanogenmod.app.SettingsManager;
+
+/**
+ * Tests functionality added in {@link cyanogenmod.app.SettingsManager}
+ */
+public class CMSettingsManagerTest extends TestActivity {
+ SettingsManager mSettingsManager;
+ @Override
+ protected String tag() {
+ return null;
+ }
+
+ @Override
+ protected Test[] tests() {
+ mSettingsManager = SettingsManager.getInstance(this);
+ return mTests;
+ }
+
+ private Test[] mTests = new Test[] {
+ new Test("Test set airplane mode to on") {
+ public void run() {
+ mSettingsManager.setAirplaneModeEnabled(true);
+ }
+ },
+ new Test("Test set airplane mode to off") {
+ public void run() {
+ mSettingsManager.setAirplaneModeEnabled(false);
+ }
+ },
+ new Test("Test set mobile data to on") {
+ public void run() {
+ mSettingsManager.setMobileDataEnabled(true);
+ }
+ },
+ new Test("Test set mobile data to off") {
+ public void run() {
+ mSettingsManager.setMobileDataEnabled(false);
+ }
+ },
+ new Test("Test reboot the device") {
+ public void run() {
+ mSettingsManager.rebootDevice();
+ }
+ },
+ new Test("Test shutdown the device") {
+ public void run() {
+ mSettingsManager.shutdownDevice();
+ }
+ }
+ };
+}