diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b38649ef..cce6703d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -326,15 +326,6 @@ - - diff --git a/exit_wizard.sh b/exit_wizard.sh index bfdaf8ab..efc3a769 100755 --- a/exit_wizard.sh +++ b/exit_wizard.sh @@ -3,18 +3,18 @@ adb root wait ${!} has_google_suw=$(adb shell pm list packages com.google.android.setupwizard) -adb shell pm enable org.lineageos.setupwizard/org.lineageos.setupwizard.FinishActivity || true +adb shell pm enable org.lineageos.setupwizard/.FinishActivity || true if [[ ! -z "$has_google_suw" ]] then wait ${!} - adb shell pm enable com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity || true + adb shell pm enable com.google.android.setupwizard/.SetupWizardExitActivity || true wait ${!} fi sleep 1 -adb shell am start org.lineageos.setupwizard/org.lineageos.setupwizard.FinishActivity || true +adb shell am start org.lineageos.setupwizard/.FinishActivity || true if [[ ! -z "$has_google_suw" ]] then wait ${!} sleep 1 - adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardExitActivity + adb shell am start com.google.android.setupwizard/.SetupWizardExitActivity fi diff --git a/src/org/lineageos/setupwizard/SetupWizardTestActivity.java b/src/org/lineageos/setupwizard/SetupWizardTestActivity.java deleted file mode 100644 index 912964b3..00000000 --- a/src/org/lineageos/setupwizard/SetupWizardTestActivity.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2017 The LineageOS 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 org.lineageos.setupwizard; - -import static android.content.pm.PackageManager.GET_ACTIVITIES; -import static android.content.pm.PackageManager.GET_RECEIVERS; -import static android.content.pm.PackageManager.GET_SERVICES; -import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS; - -import static org.lineageos.setupwizard.SetupWizardApp.LOGV; - -import android.app.Activity; -import android.content.Intent; -import android.net.wifi.WifiConfiguration; -import android.net.wifi.WifiManager; -import android.os.Bundle; -import android.provider.Settings; -import android.util.Log; - -import org.lineageos.setupwizard.util.SetupWizardUtils; - -import java.util.List; - -public class SetupWizardTestActivity extends Activity { - - private static final String TAG = SetupWizardTestActivity.class.getSimpleName(); - - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - if (LOGV) { - Log.v(TAG, "onCreate savedInstanceState=" + savedInstanceState); - } - if (SetupWizardUtils.isOwner()) { - Settings.Global.putInt(getContentResolver(), "device_provisioned", 0); - } - Settings.Secure.putInt(getContentResolver(), "user_setup_complete", 0); - SetupWizardUtils.resetComponentSets(this, GET_ACTIVITIES | - GET_RECEIVERS | GET_SERVICES | MATCH_DISABLED_COMPONENTS); - forgetAllWifi(); - Intent setupIntent = new Intent("android.intent.action.MAIN") - .addCategory("android.intent.category.HOME") - .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_GRANT_READ_URI_PERMISSION); - SetupWizardUtils.disableComponentsForMissingFeatures(this); - startActivity(setupIntent); - finish(); - } - - private void forgetAllWifi() { - WifiManager wm = getSystemService(WifiManager.class); - if (wm != null) { - List configs = wm.getConfiguredNetworks(); - if (configs != null) { - for (WifiConfiguration config : configs) { - wm.forget(config.networkId, null); - } - } - } - } -} diff --git a/start_lineage_wizard.sh b/start_lineage_wizard.sh index 09ab6d1f..64425390 100755 --- a/start_lineage_wizard.sh +++ b/start_lineage_wizard.sh @@ -2,6 +2,10 @@ adb root wait ${!} +adb shell pm enable org.lineageos.setupwizard || true +wait ${!} +adb shell pm enable org.lineageos.setupwizard/.SetupWizardActivity || true +wait ${!} if adb shell pm list packages | grep com.google.android.setupwizard; then adb shell pm disable com.google.android.setupwizard || true wait ${!} @@ -10,4 +14,4 @@ if adb shell pm list packages | grep com.android.provision; then adb shell pm disable com.android.provision || true wait ${!} fi -adb shell am start org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardTestActivity +adb shell am start -c android.intent.category.HOME org.lineageos.setupwizard/.SetupWizardActivity diff --git a/start_lineage_wizard_with_gms.sh b/start_lineage_wizard_with_gms.sh index 11a533cd..bcee34ac 100755 --- a/start_lineage_wizard_with_gms.sh +++ b/start_lineage_wizard_with_gms.sh @@ -2,13 +2,15 @@ adb root wait ${!} +adb shell pm enable org.lineageos.setupwizard || true +wait ${!} +adb shell pm enable org.lineageos.setupwizard/.SetupWizardActivity || true +wait ${!} adb shell pm enable com.google.android.setupwizard || true wait ${!} if adb shell pm list packages | grep com.android.provision; then adb shell pm disable com.android.provision || true wait ${!} fi -adb shell am start org.lineageos.setupwizard/org.lineageos.setupwizard.SetupWizardTestActivity -wait ${!} sleep 1 -adb shell am start com.google.android.setupwizard/com.google.android.setupwizard.SetupWizardTestActivity +adb shell am start com.google.android.setupwizard/.SetupWizardTestActivity diff --git a/tests/Android.mk b/tests/Android.mk deleted file mode 100644 index 61db411e..00000000 --- a/tests/Android.mk +++ /dev/null @@ -1,31 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -LOCAL_PRIVILEGED_MODULE := true - -LOCAL_STATIC_JAVA_LIBRARIES := \ - org.lineageos.platform.internal - -# Include all test java files. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := LineageSetupWizardTests -LOCAL_CERTIFICATE := platform - -LOCAL_PRIVATE_PLATFORM_APIS := true - -LOCAL_REQUIRED_MODULES := privapp_whitelist_org.lineageos.setupwizard-tests.xml - -LOCAL_USES_LIBRARIES := android.test.runner - -include $(BUILD_PACKAGE) - -include $(CLEAR_VARS) -LOCAL_MODULE := privapp_whitelist_org.lineageos.setupwizard-tests.xml -LOCAL_MODULE_CLASS := ETC -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions -LOCAL_SRC_FILES := $(LOCAL_MODULE) -include $(BUILD_PREBUILT) diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml deleted file mode 100644 index 733fa4b2..00000000 --- a/tests/AndroidManifest.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - > - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/privapp_whitelist_org.lineageos.setupwizard-tests.xml b/tests/privapp_whitelist_org.lineageos.setupwizard-tests.xml deleted file mode 100644 index 255596c4..00000000 --- a/tests/privapp_whitelist_org.lineageos.setupwizard-tests.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/tests/res/drawable/icon.png b/tests/res/drawable/icon.png deleted file mode 100644 index 0a2f2e4d..00000000 Binary files a/tests/res/drawable/icon.png and /dev/null differ diff --git a/tests/res/layout/setupwizard_test.xml b/tests/res/layout/setupwizard_test.xml deleted file mode 100644 index 488f6911..00000000 --- a/tests/res/layout/setupwizard_test.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -