summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-09-28 14:03:57 -0700
committerJean-Baptiste Queru <jbq@google.com>2009-09-28 14:58:49 -0700
commitc4a805bf940c808a822c2de244f8becf43089c87 (patch)
treec8ffa08f80bee9197067581b35a049d4164225f6 /src
parent058647d1e7c243c6e7bc38fbc313f4d72cabaecb (diff)
downloadplatform_packages_apps_Provision-c4a805bf940c808a822c2de244f8becf43089c87.tar.gz
platform_packages_apps_Provision-c4a805bf940c808a822c2de244f8becf43089c87.tar.bz2
platform_packages_apps_Provision-c4a805bf940c808a822c2de244f8becf43089c87.zip
Initial version of a provisioning app.
Currently only sets up the provisioned bit. Derived from development/apps/SdkSetup, adapted to be usable on devices without security concerns.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/provision/DefaultActivity.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/com/android/provision/DefaultActivity.java b/src/com/android/provision/DefaultActivity.java
new file mode 100644
index 0000000..0cc5d34
--- /dev/null
+++ b/src/com/android/provision/DefaultActivity.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.provision;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.provider.Settings;
+
+/**
+ * Application that sets the provisioned bit, like SetupWizard does.
+ */
+public class DefaultActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+
+ // Add a persistent setting to allow other apps to know the device has been provisioned.
+ Settings.Secure.putInt(getContentResolver(), Settings.Secure.DEVICE_PROVISIONED, 1);
+
+ // remove this activity from the package manager.
+ PackageManager pm = getPackageManager();
+ ComponentName name = new ComponentName(this, DefaultActivity.class);
+ pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, 0);
+
+ // terminate the activity.
+ finish();
+ }
+}
+