Fix build and cleanup repo

This commit is contained in:
Tad 2017-02-15 20:52:03 -05:00
parent 00673a78f0
commit bd29d92192
10 changed files with 41 additions and 1530 deletions

View File

@ -1,54 +0,0 @@
From c46d22ad7a92e72f4ba9ba3a36e8dbdb566f4a07 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Sun, 18 Dec 2016 09:36:07 -0500
Subject: [PATCH] Hide passwords by default
Change-Id: I95e26ff6219f6209d5b9fc7ae92a453b53b0aa76
---
core/java/android/text/method/TextKeyListener.java | 2 +-
core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java | 2 +-
packages/Keyguard/src/com/android/keyguard/PasswordTextView.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/java/android/text/method/TextKeyListener.java b/core/java/android/text/method/TextKeyListener.java
index 994f3d7..b2ac244 100644
--- a/core/java/android/text/method/TextKeyListener.java
+++ b/core/java/android/text/method/TextKeyListener.java
@@ -291,7 +291,7 @@ public class TextKeyListener extends BaseKeyListener implements SpanWatcher {
boolean cap = System.getInt(resolver, System.TEXT_AUTO_CAPS, 1) > 0;
boolean text = System.getInt(resolver, System.TEXT_AUTO_REPLACE, 1) > 0;
boolean period = System.getInt(resolver, System.TEXT_AUTO_PUNCTUATE, 1) > 0;
- boolean pw = System.getInt(resolver, System.TEXT_SHOW_PASSWORD, 1) > 0;
+ boolean pw = System.getInt(resolver, System.TEXT_SHOW_PASSWORD, 0) > 0;
mPrefs = (cap ? AUTO_CAP : 0) |
(text ? AUTO_TEXT : 0) |
diff --git a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java
index b2c9dc5..dc5b7f9 100644
--- a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java
+++ b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java
@@ -159,7 +159,7 @@ public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener {
mKeyboardState = KEYBOARD_STATE_NORMAL;
final boolean visiblePassword = Settings.System.getInt(
mContext.getContentResolver(),
- Settings.System.TEXT_SHOW_PASSWORD, 1) != 0;
+ Settings.System.TEXT_SHOW_PASSWORD, 0) != 0;
final boolean enablePreview = false; // TODO: grab from configuration
mKeyboardView.setPreviewEnabled(visiblePassword && enablePreview);
break;
diff --git a/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java b/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java
index 48737f9..3f4c381 100644
--- a/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java
+++ b/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java
@@ -134,7 +134,7 @@ public class PasswordTextView extends View {
mDrawPaint.setColor(0xffffffff);
mDrawPaint.setTypeface(Typeface.create("sans-serif-light", 0));
mShowPassword = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.TEXT_SHOW_PASSWORD, 1) == 1;
+ Settings.System.TEXT_SHOW_PASSWORD, 0) == 1;
mAppearInterpolator = AnimationUtils.loadInterpolator(mContext,
android.R.interpolator.linear_out_slow_in);
mDisappearInterpolator = AnimationUtils.loadInterpolator(mContext,
--
2.9.3

View File

@ -1,34 +0,0 @@
From 58a843a4197360a4522290897571017469eec6fa Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 8 Feb 2017 14:48:17 -0500
Subject: [PATCH] Build fixes
Change-Id: I227db20b7e0bdee8e13decf3ef3c51c17627973a
---
Android.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Android.mk b/Android.mk
index ddd5608..35414f3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -21,14 +21,14 @@ LOCAL_PACKAGE_NAME := GmsCore
gmscore_root := $(LOCAL_PATH)
gmscore_dir := play-services-core
-gmscore_out := $(OUT_DIR)/target/common/obj/APPS/$(LOCAL_MODULE)_intermediates
+gmscore_out := $(PWD)/$(OUT_DIR)/target/common/obj/APPS/$(LOCAL_MODULE)_intermediates
gmscore_build := $(gmscore_root)/$(gmscore_dir)/build
gmscore_apk := build/outputs/apk/play-services-core-release-unsigned.apk
$(gmscore_root)/$(gmscore_dir)/$(gmscore_apk):
rm -Rf $(gmscore_build)
mkdir -p $(ANDROID_BUILD_TOP)/$(gmscore_out)
- ln -s $(ANDROID_BUILD_TOP)/$(gmscore_out) $(ANDROID_BUILD_TOP)/$(gmscore_build)
+ ln -sf $(ANDROID_BUILD_TOP)/$(gmscore_out) $(ANDROID_BUILD_TOP)/$(gmscore_build)
echo "sdk.dir=$(ANDROID_HOME)" > $(gmscore_root)/local.properties
cd $(gmscore_root) && git submodule update --recursive --init
cd $(gmscore_root)/$(gmscore_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ../gradlew assembleRelease
--
2.9.3

View File

@ -1,48 +0,0 @@
From a81802188eb54670b838386dbad88e23d523d6be Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Tue, 17 Jan 2017 18:00:03 -0500
Subject: [PATCH] Fix build tools
Change-Id: I6600bf9bd000ae0c6d900613e487776ddd383527
---
Android.mk | 4 ++--
build.gradle | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Android.mk b/Android.mk
index 50889ae..5193277 100644
--- a/Android.mk
+++ b/Android.mk
@@ -21,14 +21,14 @@ LOCAL_PACKAGE_NAME := GsfProxy
gsfproxy_root := $(LOCAL_PATH)
gsfproxy_dir := services-framework-proxy
-gsfproxy_out := $(OUT_DIR)/target/common/obj/APPS/$(LOCAL_MODULE)_intermediates
+gsfproxy_out := $(PWD)/$(OUT_DIR)/target/common/obj/APPS/$(LOCAL_MODULE)_intermediates
gsfproxy_build := $(gsfproxy_root)/$(gsfproxy_dir)/build
gsfproxy_apk := build/outputs/apk/services-framework-proxy-release-unsigned.apk
$(gsfproxy_root)/$(gsfproxy_dir)/$(gsfproxy_apk):
rm -Rf $(gsfproxy_build)
mkdir -p $(gsfproxy_out)
- ln -s $(gsfproxy_out) $(gsfproxy_build)
+ ln -sf $(gsfproxy_out) $(gsfproxy_build)
echo "sdk.dir=$(ANDROID_HOME)" > $(gsfproxy_root)/local.properties
cd $(gsfproxy_root) && git submodule update --recursive --init
cd $(gsfproxy_root)/$(gsfproxy_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ../gradlew assembleRelease
diff --git a/build.gradle b/build.gradle
index 3ec4bfc..8a7d2e2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,7 +26,7 @@ buildscript {
allprojects {
apply plugin: 'idea'
- ext.androidBuildVersionTools = "24.0.3"
+ ext.androidBuildVersionTools = "25.0.1"
ext.isReleaseVersion = false
}
--
2.9.3

View File

@ -1,29 +0,0 @@
From 5cb02870e993ec2704645ade6d5fb79ed56ee710 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Sun, 18 Dec 2016 09:38:09 -0500
Subject: [PATCH] Disable NFC and NDEF by default
Change-Id: I227fa330916166346e6dfc1aff36b40c993fa57f
---
src/com/android/nfc/NfcService.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index ab50f23..bd78f77 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -105,9 +105,9 @@ public class NfcService implements DeviceHostListener {
public static final String PREF = "NfcServicePrefs";
static final String PREF_NFC_ON = "nfc_on";
- static final boolean NFC_ON_DEFAULT = true;
+ static final boolean NFC_ON_DEFAULT = false;
static final String PREF_NDEF_PUSH_ON = "ndef_push_on";
- static final boolean NDEF_PUSH_ON_DEFAULT = true;
+ static final boolean NDEF_PUSH_ON_DEFAULT = false;
static final String PREF_FIRST_BEAM = "first_beam";
static final String PREF_FIRST_BOOT = "first_boot";
--
2.9.3

View File

@ -1,40 +0,0 @@
From 40a15771d3907c6bb883e8f4829a89db241d15fe Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Sun, 18 Dec 2016 09:41:02 -0500
Subject: [PATCH] Hide passwords by default
Change-Id: I5329a76ea7a93da95fbb4e02a114b0aa5fd368bd
---
src/com/android/settings/CryptKeeperConfirm.java | 2 +-
src/com/android/settings/SecuritySettings.java | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/com/android/settings/CryptKeeperConfirm.java b/src/com/android/settings/CryptKeeperConfirm.java
index 1cc5b6a..4162232 100644
--- a/src/com/android/settings/CryptKeeperConfirm.java
+++ b/src/com/android/settings/CryptKeeperConfirm.java
@@ -129,7 +129,7 @@ public class CryptKeeperConfirm extends InstrumentedFragment {
}
int value = Settings.System.getInt(getContext().getContentResolver(),
Settings.System.TEXT_SHOW_PASSWORD,
- 1);
+ 0);
utils.setVisiblePasswordEnabled(value != 0, UserHandle.USER_SYSTEM);
Intent intent = new Intent(getActivity(), Blank.class);
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 106eedf..f3c0976 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -621,7 +621,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
if (mShowPassword != null) {
mShowPassword.setChecked(Settings.System.getInt(getContentResolver(),
- Settings.System.TEXT_SHOW_PASSWORD, 1) != 0);
+ Settings.System.TEXT_SHOW_PASSWORD, 0) != 0);
}
if (mResetCredentials != null && !mResetCredentials.isDisabledByAdmin()) {
--
2.9.3

View File

@ -0,0 +1,35 @@
From bc2634952ca1c7b1d422941ac5738e91ca64b79c Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 15 Feb 2017 20:49:06 -0500
Subject: [PATCH] Fucking no
Change-Id: I44ba18bf4efabfcc1807df89098ee4f2cee72d02
---
src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
index 5571630..f1fb6a9 100644
--- a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
+++ b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java
@@ -166,17 +166,6 @@ public class SetupWizardUtils {
}
public static boolean hasGMS(Context context) {
- if (PackageManagerUtils
- .isAppInstalled(context, "com.google.android.gms")) {
- PackageManager packageManager = context.getPackageManager();
- if (LOGV) {
- Log.v(TAG, "com.google.android.setupwizard state =" + packageManager
- .getApplicationEnabledSetting("com.google.android.setupwizard"));
- }
- return packageManager
- .getApplicationEnabledSetting("com.google.android.setupwizard") !=
- COMPONENT_ENABLED_STATE_DISABLED;
- }
return false;
}
--
2.9.3

View File

@ -1,937 +0,0 @@
From e7d0e4c5b24240b013478013799c39baabdac547 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Tue, 17 Jan 2017 20:35:41 -0500
Subject: [PATCH] Remove stats
Change-Id: I1329ce8a8eb88d395f71f84e070bbb335e290065
---
AndroidManifest.xml | 1 -
.../setupwizard/cmstats/SetupStats.java | 163 ---------------------
.../setupwizard/cmstats/StatsUtils.java | 44 ------
.../setupwizard/setup/BluetoothSetupPage.java | 7 -
.../setupwizard/setup/ChooseDataSimPage.java | 4 -
.../setupwizard/setup/CyanogenSettingsPage.java | 55 -------
.../setupwizard/setup/DateTimePage.java | 19 ---
.../setupwizard/setup/FingerprintSetupPage.java | 4 -
.../setupwizard/setup/GmsAccountPage.java | 22 ---
.../cyanogenmod/setupwizard/setup/LocalePage.java | 12 --
.../setupwizard/setup/MobileDataPage.java | 4 -
.../setupwizard/setup/OtherSettingsPage.java | 13 --
.../setupwizard/setup/ScreenLockSetupPage.java | 4 -
.../cyanogenmod/setupwizard/setup/SetupPage.java | 7 -
.../cyanogenmod/setupwizard/setup/WelcomePage.java | 5 -
.../setupwizard/setup/WifiSetupPage.java | 25 ----
.../setupwizard/ui/SetupPageFragment.java | 3 -
.../setupwizard/ui/SetupWizardActivity.java | 6 -
.../util/EnableAccessibilityController.java | 3 -
19 files changed, 401 deletions(-)
delete mode 100644 src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java
delete mode 100644 src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 2353fb7..51ba684 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -43,7 +43,6 @@
<uses-permission android:name="android.permission.BACKUP" />
<uses-permission android:name="cyanogenmod.permission.FINISH_SETUP" />
<uses-permission android:name="cyanogenmod.permission.LEGALESE" />
- <uses-permission android:name="com.cyngn.stats.SEND_ANALYTICS" />
<uses-permission android:name="com.cyanogen.permission.REQUEST_KILL_SWITCH_OP" />
<uses-permission android:name="cyanogenmod.permission.WRITE_SETTINGS"/>
<uses-permission android:name="cyanogenmod.permission.WRITE_SECURE_SETTINGS"/>
diff --git a/src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java b/src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java
deleted file mode 100644
index f3a47b3..0000000
--- a/src/com/cyanogenmod/setupwizard/cmstats/SetupStats.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2014 The CyanogenMod 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.cyanogenmod.setupwizard.cmstats;
-
-import android.content.Context;
-import android.content.Intent;
-import android.os.UserHandle;
-import android.util.Log;
-
-import java.util.LinkedList;
-
-
-public class SetupStats {
-
- private static final String TAG = SetupStats.class.getSimpleName();
-
- private static final String ANALYTIC_INTENT = "com.cyngn.stats.action.SEND_ANALYTIC_EVENT";
- private static final String ANALYTIC_PERMISSION = "com.cyngn.stats.SEND_ANALYTICS";
-
- public static final String TRACKING_ID = "tracking_id";
-
- private final LinkedList<Event> mEvents = new LinkedList<Event>();
-
- private static final SetupStats sInstance = new SetupStats();
-
- private static final boolean DEBUG = false;
-
- private SetupStats() {}
-
- public static void addEvent(String category, String action,
- String label, String value) {
- sInstance.mEvents.add(new Event(category, action, label, value));
- }
-
- public static void addEvent(String category, String action) {
- sInstance.mEvents.add(new Event(category, action, null, null));
- }
-
- public static void sendEvents(Context context) {
- while (!sInstance.mEvents.isEmpty()) {
- sInstance.sendEvent(context, sInstance.mEvents.remove());
- }
- }
-
- private void sendEvent(Context context, Event event) {
-
- if (!StatsUtils.isStatsPackageInstalled(context)
- || !StatsUtils.isStatsCollectionEnabled(context)) {
- return;
- }
-
- // Create new intent
- Intent intent = new Intent();
- intent.setAction(ANALYTIC_INTENT);
-
- // add tracking id
- intent.putExtra(TRACKING_ID, context.getPackageName());
- // append
- intent.putExtra(Fields.EVENT_CATEGORY, event.category);
- if (DEBUG) Log.d(TAG, Fields.EVENT_CATEGORY + "=" + event.category);
- intent.putExtra(Fields.EVENT_ACTION, event.action);
- if (DEBUG) Log.d(TAG, Fields.EVENT_ACTION + "=" + event.action);
- // check if exist
- if (event.label != null) {
- intent.putExtra(Fields.EVENT_LABEL, event.label);
- if (DEBUG) Log.d(TAG, Fields.EVENT_LABEL + "=" + event.label);
- }
-
- if (event.value != null) {
- intent.putExtra(Fields.EVENT_VALUE, event.value);
- if (DEBUG) Log.d(TAG, Fields.EVENT_VALUE + "=" + event.value);
- }
-
- // broadcast for internal package
- context.sendBroadcastAsUser(intent,
- new UserHandle(UserHandle.USER_CURRENT), ANALYTIC_PERMISSION);
- }
-
- private static final class Event {
- private final String category;
- private final String action;
- private final String label;
- private final String value;
-
- public Event(String category, String action, String label, String value) {
- this.action = action;
- this.category = category;
- this.label = label;
- this.value = value;
- }
- }
-
- public static final class Fields {
- public static final String EVENT_CATEGORY = "category";
- public static final String EVENT_ACTION = "action";
- public static final String EVENT_LABEL = "label";
- public static final String EVENT_VALUE = "value";
- }
-
- public static final class Categories {
- public static final String APP_LAUNCH = "app_launch";
- public static final String APP_FINISHED = "app_finish";
- public static final String PAGE_LOAD = "page_load";
- public static final String EXTERNAL_PAGE_LOAD = "external_page_load";
- public static final String BUTTON_CLICK = "button_click";
- public static final String SETTING_CHANGED = "setting_changed";
- }
-
- public static final class Action {
- public static final String PAGE_LOADED = "page_loaded";
- public static final String PREVIOUS_BUTTON = "previous_button";
- public static final String NEXT_BUTTON = "next_button";
- public static final String CHANGE_LOCALE = "change_local";
- public static final String EXTERNAL_PAGE_LAUNCH = "external_page_launch";
- public static final String EXTERNAL_PAGE_RESULT = "external_page_result";
- public static final String ENABLE_MOBILE_DATA = "enable_mobile_data";
- public static final String PREFERRED_DATA_SIM = "preferred_data_sim";
- public static final String APPLY_CUSTOM_THEME = "apply_custom_theme";
- public static final String USE_SECURE_SMS = "use_secure_sms";
- public static final String ENABLE_BACKUP = "enable_backup";
- public static final String ENABLE_NAV_KEYS = "enable_nav_keys";
- public static final String ENABLE_LOCATION = "enable_location";
- public static final String ENABLE_NETWORK_LOCATION = "enable_network_location";
- public static final String ENABLE_GPS_LOCATION = "enable_gps_location";
- public static final String DATE_CHANGED = "date_changed";
- public static final String TIME_CHANGED = "time_changed";
- public static final String TIMEZONE_CHANGED = "timezone_changed";
- }
-
- public static final class Label {
- public static final String PAGE = "page";
- public static final String LOCALE = "local";
- public static final String RESULT = "result";
- public static final String WIFI_SETUP = "wifi_setup";
- public static final String BLUETOOTH_SETUP = "bluetooth_setup";
- public static final String CYANOGEN_ACCOUNT = "cyanogen_account_setup";
- public static final String CAPTIVE_PORTAL_LOGIN = "captive_portal_login";
- public static final String EMERGENCY_CALL = "emergency_call";
- public static final String GMS_ACCOUNT = "gms_account";
- public static final String RESTORE = "restore";
- public static final String CHECKED = "checked";
- public static final String VALUE = "value";
- public static final String SLOT = "slot";
- public static final String TOTAL_TIME = "total_time";
- public static final String FINGERPRINT_SETUP = "fingerprint_setup";
- public static final String LOCKSCREEN_SETUP = "lockscreen_setup";
- }
-
-}
diff --git a/src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java b/src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java
deleted file mode 100644
index 8be8fad..0000000
--- a/src/com/cyanogenmod/setupwizard/cmstats/StatsUtils.java
+++ /dev/null
@@ -1,44 +0,0 @@
-
-/*
- * Copyright (C) 2014 The CyanogenMod 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.cyanogenmod.setupwizard.cmstats;
-
-import android.content.Context;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-
-import cyanogenmod.providers.CMSettings;
-
-public class StatsUtils {
- private static final String STATS_PACKAGE = "com.cyngn.stats";
-
- public static boolean isStatsCollectionEnabled(Context context) {
- return CMSettings.Secure.getInt(context.getContentResolver(),
- CMSettings.Secure.STATS_COLLECTION, 1) != 0;
- }
-
- public static boolean isStatsPackageInstalled(Context context) {
- try {
- PackageInfo pi = context.getPackageManager().getPackageInfo(STATS_PACKAGE, 0);
- return pi.applicationInfo.enabled
- && ((pi.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
- } catch (PackageManager.NameNotFoundException e) {
- return false;
- }
- }
-}
diff --git a/src/com/cyanogenmod/setupwizard/setup/BluetoothSetupPage.java b/src/com/cyanogenmod/setupwizard/setup/BluetoothSetupPage.java
index d1532ac..829f24f 100644
--- a/src/com/cyanogenmod/setupwizard/setup/BluetoothSetupPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/BluetoothSetupPage.java
@@ -29,7 +29,6 @@ import android.util.Log;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.LoadingFragment;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -96,9 +95,6 @@ public class BluetoothSetupPage extends SetupPage {
@Override
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == SetupWizardApp.REQUEST_CODE_SETUP_BLUETOOTH) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.BLUETOOTH_SETUP, "success");
getCallbacks().onNextPage();
} else {
return false;
@@ -116,9 +112,6 @@ public class BluetoothSetupPage extends SetupPage {
ActivityOptions.makeCustomAnimation(mContext,
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.BLUETOOTH_SETUP);
mLoadingFragment.startActivityForResult(intent,
SetupWizardApp.REQUEST_CODE_SETUP_BLUETOOTH, options.toBundle());
}
diff --git a/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java b/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java
index 073d6d9..6ab9ae9 100644
--- a/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/ChooseDataSimPage.java
@@ -49,7 +49,6 @@ import com.android.internal.telephony.TelephonyIntents;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -360,9 +359,6 @@ public class ChooseDataSimPage extends SetupPage {
for (int i = 0; i < mCheckBoxes.size(); i++) {
if (subInfoRecord.getSimSlotIndex() == i) {
mCheckBoxes.get(i).setChecked(true);
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.PREFERRED_DATA_SIM,
- SetupStats.Label.SLOT, String.valueOf(i + 1));
} else {
mCheckBoxes.get(i).setChecked(false);
}
diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
index 866371d..2cf7ad9 100644
--- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
@@ -43,7 +43,6 @@ import android.widget.TextView;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -55,7 +54,6 @@ public class CyanogenSettingsPage extends SetupPage {
public static final String TAG = "CyanogenSettingsPage";
- public static final String KEY_SEND_METRICS = "send_metrics";
public static final String DISABLE_NAV_KEYS = "disable_nav_keys";
public static final String KEY_APPLY_DEFAULT_THEME = "apply_default_theme";
public static final String KEY_BUTTON_BACKLIGHT = "pre_navbar_button_backlight";
@@ -123,38 +121,19 @@ public class CyanogenSettingsPage extends SetupPage {
@Override
public void run() {
if (getData().containsKey(DISABLE_NAV_KEYS)) {
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.ENABLE_NAV_KEYS,
- SetupStats.Label.CHECKED,
- String.valueOf(getData().getBoolean(DISABLE_NAV_KEYS)));
writeDisableNavkeysOption(mContext, getData().getBoolean(DISABLE_NAV_KEYS));
}
}
});
- handleEnableMetrics();
handleDefaultThemeSetup();
handlePrivacyGuard();
}
- private void handleEnableMetrics() {
- Bundle privacyData = getData();
- if (privacyData != null
- && privacyData.containsKey(KEY_SEND_METRICS)) {
- CMSettings.Secure.putInt(mContext.getContentResolver(),
- CMSettings.Secure.STATS_COLLECTION, privacyData.getBoolean(KEY_SEND_METRICS)
- ? 1 : 0);
- }
- }
-
private void handleDefaultThemeSetup() {
Bundle privacyData = getData();
if (!SetupWizardUtils.getDefaultThemePackageName(mContext).equals(
ThemeConfig.SYSTEM_DEFAULT) && privacyData != null &&
privacyData.getBoolean(KEY_APPLY_DEFAULT_THEME)) {
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.APPLY_CUSTOM_THEME,
- SetupStats.Label.CHECKED,
- String.valueOf(privacyData.getBoolean(KEY_APPLY_DEFAULT_THEME)));
Log.i(TAG, "Applying default theme");
final ThemeManager tm = ThemeManager.getInstance(mContext);
tm.applyDefaultTheme();
@@ -193,11 +172,9 @@ public class CyanogenSettingsPage extends SetupPage {
private View mKillSwitchView;
private TextView mKillSwitchTitle;
private ImageView mKillSwitchStatus;
- private View mMetricsRow;
private View mDefaultThemeRow;
private View mNavKeysRow;
private View mPrivacyGuardRow;
- private CheckBox mMetrics;
private CheckBox mDefaultTheme;
private CheckBox mNavKeys;
private CheckBox mPrivacyGuard;
@@ -206,15 +183,6 @@ public class CyanogenSettingsPage extends SetupPage {
private boolean mHideThemeRow = false;
- private View.OnClickListener mMetricsClickListener = new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- boolean checked = !mMetrics.isChecked();
- mMetrics.setChecked(checked);
- mPage.getData().putBoolean(KEY_SEND_METRICS, checked);
- }
- };
-
private View.OnClickListener mDefaultThemeClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -283,19 +251,6 @@ public class CyanogenSettingsPage extends SetupPage {
}
}
- mMetricsRow = mRootView.findViewById(R.id.metrics);
- mMetricsRow.setOnClickListener(mMetricsClickListener);
- String metricsHelpImproveCM =
- getString(R.string.services_help_improve_cm, getString(R.string.os_name));
- String metricsSummary = getString(R.string.services_metrics_label,
- metricsHelpImproveCM, getString(R.string.os_name));
- final SpannableStringBuilder metricsSpan = new SpannableStringBuilder(metricsSummary);
- metricsSpan.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD),
- 0, metricsHelpImproveCM.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- TextView metrics = (TextView) mRootView.findViewById(R.id.enable_metrics_summary);
- metrics.setText(metricsSpan);
- mMetrics = (CheckBox) mRootView.findViewById(R.id.enable_metrics_checkbox);
-
mDefaultThemeRow = mRootView.findViewById(R.id.theme);
mHideThemeRow = hideThemeSwitch(getActivity());
if (mHideThemeRow) {
@@ -350,19 +305,9 @@ public class CyanogenSettingsPage extends SetupPage {
public void onResume() {
super.onResume();
updateDisableNavkeysOption();
- updateMetricsOption();
updateThemeOption();
}
- private void updateMetricsOption() {
- final Bundle myPageBundle = mPage.getData();
- boolean metricsChecked =
- !myPageBundle.containsKey(KEY_SEND_METRICS) || myPageBundle
- .getBoolean(KEY_SEND_METRICS);
- mMetrics.setChecked(metricsChecked);
- myPageBundle.putBoolean(KEY_SEND_METRICS, metricsChecked);
- }
-
private void updateThemeOption() {
if (!mHideThemeRow) {
final Bundle myPageBundle = mPage.getData();
diff --git a/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java b/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
index f42240f..7e045ad 100644
--- a/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/DateTimePage.java
@@ -43,7 +43,6 @@ import android.widget.TextView;
import android.widget.TimePicker;
import com.cyanogenmod.setupwizard.R;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import org.xmlpull.v1.XmlPullParserException;
@@ -142,8 +141,6 @@ public class DateTimePage extends SetupPage {
mDateView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
- "date_picker");
showDatePicker();
}
});
@@ -151,8 +148,6 @@ public class DateTimePage extends SetupPage {
mTimeView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
- "time_picker");
showTimePicker();
}
});
@@ -173,17 +168,11 @@ public class DateTimePage extends SetupPage {
final Map<?, ?> map = (Map<?, ?>) adapterView.getItemAtPosition(position);
final String tzId = (String) map.get(KEY_ID);
if (mCurrentTimeZone != null && !mCurrentTimeZone.getID().equals(tzId)) {
- SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
- "timezone_picker");
// Update the system timezone value
final Activity activity = getActivity();
final AlarmManager alarm = (AlarmManager) activity.getSystemService(Context.ALARM_SERVICE);
alarm.setTimeZone(tzId);
mCurrentTimeZone = TimeZone.getTimeZone(tzId);
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.TIMEZONE_CHANGED,
- SetupStats.Label.VALUE,
- mCurrentTimeZone.getDisplayName());
}
}
@@ -238,10 +227,6 @@ public class DateTimePage extends SetupPage {
if (activity != null) {
setDate(activity, year, month, day);
updateTimeAndDateDisplay(activity);
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.DATE_CHANGED,
- SetupStats.Label.VALUE,
- month+"/"+day+"/"+year);
}
}
@@ -251,10 +236,6 @@ public class DateTimePage extends SetupPage {
if (activity != null) {
setTime(activity, hourOfDay, minute);
updateTimeAndDateDisplay(activity);
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.TIME_CHANGED,
- SetupStats.Label.VALUE,
- hourOfDay+":"+minute);
}
}
diff --git a/src/com/cyanogenmod/setupwizard/setup/FingerprintSetupPage.java b/src/com/cyanogenmod/setupwizard/setup/FingerprintSetupPage.java
index 8d78127..f079146 100644
--- a/src/com/cyanogenmod/setupwizard/setup/FingerprintSetupPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/FingerprintSetupPage.java
@@ -29,7 +29,6 @@ import android.widget.TextView;
import com.android.internal.widget.LockPatternUtils;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
public class FingerprintSetupPage extends SetupPage {
@@ -119,9 +118,6 @@ public class FingerprintSetupPage extends SetupPage {
ActivityOptions.makeCustomAnimation(getActivity(),
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.FINGERPRINT_SETUP);
startActivityForResult(intent, SetupWizardApp.REQUEST_CODE_SETUP_FINGERPRINT,
options.toBundle());
}
diff --git a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java
index 747765e..a646997 100644
--- a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java
@@ -36,7 +36,6 @@ import android.util.Log;
import com.android.setupwizardlib.util.ResultCodes;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.LoadingFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -155,9 +154,6 @@ public class GmsAccountPage extends SetupPage {
&& !data.hasExtra(EXTRA_RESTORE_ACCOUNT) &&
data.hasExtra(EXTRA_AUTH_ACCOUNT);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.GMS_ACCOUNT, "success");
launchGmsRestorePage(restorePicker);
} else {
handleResult(requestCode, resultCode);
@@ -185,24 +181,12 @@ public class GmsAccountPage extends SetupPage {
private void handleResult(int requestCode, int resultCode) {
if (resultCode == Activity.RESULT_CANCELED) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- requestCode == SetupWizardApp.REQUEST_CODE_SETUP_GMS ?
- SetupStats.Label.GMS_ACCOUNT : SetupStats.Label.RESTORE, "canceled");
getCallbacks().onPreviousPage();
} else {
if (resultCode == Activity.RESULT_OK) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- requestCode == SetupWizardApp.REQUEST_CODE_SETUP_GMS ?
- SetupStats.Label.GMS_ACCOUNT : SetupStats.Label.RESTORE, "success");
getCallbacks().onNextPage();
} else {
if (canSkip()) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- requestCode == SetupWizardApp.REQUEST_CODE_SETUP_GMS ?
- SetupStats.Label.GMS_ACCOUNT : SetupStats.Label.RESTORE, "skipped");
getCallbacks().onNextPage();
} else {
getCallbacks().onPreviousPage();
@@ -242,9 +226,6 @@ public class GmsAccountPage extends SetupPage {
ActivityOptions.makeCustomAnimation(mContext,
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.RESTORE);
mFragment.startActivityForResult(
intent,
SetupWizardApp.REQUEST_CODE_RESTORE_GMS, options.toBundle());
@@ -316,9 +297,6 @@ public class GmsAccountPage extends SetupPage {
ActivityOptions.makeCustomAnimation(mContext,
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.GMS_ACCOUNT);
mFragment.startActivityForResult(intent,
SetupWizardApp.REQUEST_CODE_SETUP_GMS, options.toBundle());
} catch (OperationCanceledException e) {
diff --git a/src/com/cyanogenmod/setupwizard/setup/LocalePage.java b/src/com/cyanogenmod/setupwizard/setup/LocalePage.java
index e9717a5..e8a86ac 100644
--- a/src/com/cyanogenmod/setupwizard/setup/LocalePage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/LocalePage.java
@@ -43,7 +43,6 @@ import android.widget.Toast;
import com.android.internal.telephony.MccTable;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.LocalePicker;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -90,9 +89,6 @@ public class LocalePage extends SetupPage {
confirmCyanogenCredentials(mLocaleFragment);
return true;
} else {
- if (mLocaleFragment != null) {
- mLocaleFragment.sendLocaleStats();
- }
return super.doNextAction();
}
}
@@ -248,14 +244,6 @@ public class LocalePage extends SetupPage {
return R.layout.setup_locale;
}
- public void sendLocaleStats() {
- if (!mCurrentLocale.equals(mInitialLocale)) {
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.CHANGE_LOCALE, SetupStats.Label.LOCALE,
- mCurrentLocale.getDisplayName());
- }
- }
-
public void fetchAndUpdateSimLocale() {
if (mIgnoreSimLocale || isDetached()) {
return;
diff --git a/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java b/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java
index 32a5c86..eb1484c 100644
--- a/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/MobileDataPage.java
@@ -39,7 +39,6 @@ import android.widget.TextView;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -153,9 +152,6 @@ public class MobileDataPage extends SetupPage {
} else {
onDataStateReady();
}
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.ENABLE_MOBILE_DATA,
- SetupStats.Label.CHECKED, String.valueOf(checked));
}
};
diff --git a/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java
index 5c0b91d..980b974 100644
--- a/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java
@@ -18,7 +18,6 @@
package com.cyanogenmod.setupwizard.setup;
import com.cyanogenmod.setupwizard.R;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -231,10 +230,6 @@ public class OtherSettingsPage extends SetupPage {
}
private void onToggleLocationAccess(boolean checked) {
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.ENABLE_LOCATION,
- SetupStats.Label.CHECKED, String.valueOf(checked));
-
if (checked) {
setLocationMode(Settings.Secure.LOCATION_MODE_SENSORS_ONLY);
} else {
@@ -243,10 +238,6 @@ public class OtherSettingsPage extends SetupPage {
}
private void onToggleBatterySaving(boolean checked) {
- /* SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.ENABLE_BATTERY_SAVING_LOCATION,
- SetupStats.Label.CHECKED, String.valueOf(checked)); */
-
if (checked) {
setLocationMode(Settings.Secure.LOCATION_MODE_BATTERY_SAVING);
} else {
@@ -255,10 +246,6 @@ public class OtherSettingsPage extends SetupPage {
}
private void onToggleNetwork(boolean checked) {
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- SetupStats.Action.ENABLE_NETWORK_LOCATION,
- SetupStats.Label.CHECKED, String.valueOf(checked));
-
if (checked) {
setLocationMode(Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);
} else {
diff --git a/src/com/cyanogenmod/setupwizard/setup/ScreenLockSetupPage.java b/src/com/cyanogenmod/setupwizard/setup/ScreenLockSetupPage.java
index abbb2de..3483764 100644
--- a/src/com/cyanogenmod/setupwizard/setup/ScreenLockSetupPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/ScreenLockSetupPage.java
@@ -28,7 +28,6 @@ import android.widget.Button;
import android.view.View;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
public class ScreenLockSetupPage extends SetupPage {
@@ -112,9 +111,6 @@ public class ScreenLockSetupPage extends SetupPage {
ActivityOptions.makeCustomAnimation(getActivity(),
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.LOCKSCREEN_SETUP);
startActivityForResult(intent, SetupWizardApp.REQUEST_CODE_SETUP_LOCKSCREEN,
options.toBundle());
}
diff --git a/src/com/cyanogenmod/setupwizard/setup/SetupPage.java b/src/com/cyanogenmod/setupwizard/setup/SetupPage.java
index 05bf9c5..142c04a 100644
--- a/src/com/cyanogenmod/setupwizard/setup/SetupPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/SetupPage.java
@@ -26,7 +26,6 @@ import android.transition.Transition;
import android.view.Gravity;
import com.cyanogenmod.setupwizard.R;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
public abstract class SetupPage implements Page {
@@ -81,18 +80,12 @@ public abstract class SetupPage implements Page {
public void doLoadAction(FragmentManager fragmentManager, int action) {
Fragment fragment = getFragment(fragmentManager, action);
if (action == Page.ACTION_NEXT) {
- SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
- SetupStats.Action.NEXT_BUTTON, getKey(),
- String.valueOf(System.currentTimeMillis()));
Transition t = new Slide(Gravity.RIGHT);
fragment.setEnterTransition(t);
fragmentManager.beginTransaction()
.replace(R.id.content,fragment, getKey())
.commit();
} else {
- SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK,
- SetupStats.Action.PREVIOUS_BUTTON, getKey(),
- String.valueOf(System.currentTimeMillis()));
Transition t = new Slide(Gravity.LEFT);
fragment.setEnterTransition(t);
fragmentManager.beginTransaction()
diff --git a/src/com/cyanogenmod/setupwizard/setup/WelcomePage.java b/src/com/cyanogenmod/setupwizard/setup/WelcomePage.java
index 2e63085..73d1e1a 100644
--- a/src/com/cyanogenmod/setupwizard/setup/WelcomePage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/WelcomePage.java
@@ -27,7 +27,6 @@ import android.os.Bundle;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
public class WelcomePage extends SetupPage {
@@ -79,10 +78,6 @@ public class WelcomePage extends SetupPage {
ActivityOptions.makeCustomAnimation(mContext,
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.BUTTON_CLICK, SetupStats.Label.EMERGENCY_CALL);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.EMERGENCY_CALL);
mContext.startActivity(intent, options.toBundle());
return true;
}
diff --git a/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java b/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java
index 051cbc3..22ad6b7 100644
--- a/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java
@@ -32,7 +32,6 @@ import android.util.Log;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.ui.LoadingFragment;
import com.cyanogenmod.setupwizard.ui.SetupPageFragment;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
@@ -87,9 +86,6 @@ public class WifiSetupPage extends SetupPage {
ActivityOptions.makeCustomAnimation(mContext,
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.CAPTIVE_PORTAL_LOGIN);
mLoadingFragment.startActivityForResult(intent,
SetupWizardApp.REQUEST_CODE_SETUP_CAPTIVE_PORTAL,
options.toBundle());
@@ -162,19 +158,10 @@ public class WifiSetupPage extends SetupPage {
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == SetupWizardApp.REQUEST_CODE_SETUP_WIFI) {
if (resultCode == Activity.RESULT_CANCELED) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.WIFI_SETUP, "canceled");
getCallbacks().onPreviousPage();
} else if (resultCode == Activity.RESULT_OK) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.WIFI_SETUP, "success");
checkForCaptivePortal();
} else {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.WIFI_SETUP, "skipped");
getCallbacks().onNextPage();
}
} else if (requestCode == SetupWizardApp.REQUEST_CODE_SETUP_CAPTIVE_PORTAL) {
@@ -184,20 +171,11 @@ public class WifiSetupPage extends SetupPage {
}
String token = data.getStringExtra("response_token");
if (token != null && !token.equals(mResponseToken)) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.CAPTIVE_PORTAL_LOGIN, "token_mismatch");
launchWifiSetup();
} else {
if (resultCode == Activity.RESULT_CANCELED) {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.CAPTIVE_PORTAL_LOGIN, "canceled");
launchWifiSetup();
} else {
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_RESULT,
- SetupStats.Label.CAPTIVE_PORTAL_LOGIN, "success");
getCallbacks().onNextPage();
}
}
@@ -261,9 +239,6 @@ public class WifiSetupPage extends SetupPage {
ActivityOptions.makeCustomAnimation(mContext,
android.R.anim.fade_in,
android.R.anim.fade_out);
- SetupStats.addEvent(SetupStats.Categories.EXTERNAL_PAGE_LOAD,
- SetupStats.Action.EXTERNAL_PAGE_LAUNCH,
- SetupStats.Label.PAGE, SetupStats.Label.WIFI_SETUP);
mLoadingFragment.startActivityForResult(intent,
SetupWizardApp.REQUEST_CODE_SETUP_WIFI, options.toBundle());
}
diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupPageFragment.java b/src/com/cyanogenmod/setupwizard/ui/SetupPageFragment.java
index 2ec8e3a..2770b14 100644
--- a/src/com/cyanogenmod/setupwizard/ui/SetupPageFragment.java
+++ b/src/com/cyanogenmod/setupwizard/ui/SetupPageFragment.java
@@ -27,7 +27,6 @@ import android.widget.ImageView;
import android.widget.TextView;
import com.cyanogenmod.setupwizard.R;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.setup.Page;
import com.cyanogenmod.setupwizard.setup.SetupDataCallbacks;
@@ -45,8 +44,6 @@ public abstract class SetupPageFragment extends Fragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
- SetupStats.addEvent(SetupStats.Categories.PAGE_LOAD, SetupStats.Action.PAGE_LOADED,
- mKey, String.valueOf(System.currentTimeMillis()));
}
@Override
diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
index d371bff..6cc651a 100644
--- a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
+++ b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
@@ -45,7 +45,6 @@ import android.widget.ProgressBar;
import com.android.setupwizardlib.util.SystemBarHelper;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import com.cyanogenmod.setupwizard.setup.CMSetupWizardData;
import com.cyanogenmod.setupwizard.setup.GmsAccountPage;
import com.cyanogenmod.setupwizard.setup.Page;
@@ -95,7 +94,6 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
}
SystemBarHelper.hideSystemBars(getWindow());
if (sLaunchTime == 0) {
- SetupStats.addEvent(SetupStats.Categories.APP_LAUNCH, TAG);
sLaunchTime = System.nanoTime();
}
setContentView(R.layout.setup_main);
@@ -361,9 +359,6 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
@Override
public void finishSetup() {
if (!mIsFinishing) {
- SetupStats.addEvent(SetupStats.Categories.APP_FINISHED, TAG,
- SetupStats.Label.TOTAL_TIME, String.valueOf(
- System.nanoTime() - sLaunchTime));
final SetupWizardApp setupWizardApp = (SetupWizardApp)getApplication();
setupWizardApp.sendStickyBroadcastAsUser(
new Intent(SetupWizardApp.ACTION_FINISHED),
@@ -453,7 +448,6 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
}
final ThemeManager tm = ThemeManager.getInstance(SetupWizardActivity.this);
tm.unregisterThemeChangeListener(SetupWizardActivity.this);
- SetupStats.sendEvents(SetupWizardActivity.this);
SetupWizardUtils.disableGMSSetupWizard(SetupWizardActivity.this);
final WallpaperManager wallpaperManager =
WallpaperManager.getInstance(SetupWizardActivity.this);
diff --git a/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java b/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java
index 440129b..47d6de5 100644
--- a/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java
+++ b/src/com/cyanogenmod/setupwizard/util/EnableAccessibilityController.java
@@ -39,7 +39,6 @@ import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.IAccessibilityManager;
import com.android.internal.R;
-import com.cyanogenmod.setupwizard.cmstats.SetupStats;
import java.util.ArrayList;
import java.util.Iterator;
@@ -284,8 +283,6 @@ public class EnableAccessibilityController {
// Turn on accessibility mode last.
Settings.Secure.putIntForUser(resolver, Settings.Secure.ACCESSIBILITY_ENABLED,
1, userId);
- SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
- "accessibility_enabled");
} else if (keyguardLocked) {
try {
mAccessibilityManager.temporaryEnableAccessibilityStateUntilKeyguardRemoved(
--
2.9.3

View File

@ -1,388 +0,0 @@
From 488e469493fc3a748ef2e517732382b82d129b09 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 25 Jan 2017 10:33:07 -0500
Subject: [PATCH] Nuke GMS
Change-Id: I898d6456f30be064a92bf59db4c0a5b8a2c02026
---
.../setupwizard/setup/CMSetupWizardData.java | 7 +-
.../setupwizard/setup/GmsAccountPage.java | 321 ---------------------
.../setupwizard/ui/SetupWizardActivity.java | 9 -
3 files changed, 1 insertion(+), 336 deletions(-)
delete mode 100644 src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java
diff --git a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
index 5c90b4e..a97e217 100644
--- a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
+++ b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java
@@ -70,12 +70,7 @@ public class CMSetupWizardData extends AbstractSetupData {
pages.add(new MobileDataPage(mContext, this)
.setHidden(!isSimInserted() || mMobileDataEnabled));
}
- final boolean hasGMS = PackageManagerUtils
- .isAppInstalled(mContext, "com.google.android.gms");
- if (hasGMS) {
- pages.add(new GmsAccountPage(mContext, this));
- }
- pages.add(new OtherSettingsPage(mContext, this).setHidden(!hasGMS));
+ pages.add(new OtherSettingsPage(mContext, this));
if (SetupWizardUtils.hasFingerprint(mContext) && SetupWizardUtils.isOwner()) {
pages.add(new FingerprintSetupPage(mContext, this));
}
diff --git a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java b/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java
deleted file mode 100644
index aec3da2..0000000
--- a/src/com/cyanogenmod/setupwizard/setup/GmsAccountPage.java
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * Copyright (C) 2013 The CyanogenMod Project
- * 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 com.cyanogenmod.setupwizard.setup;
-
-import android.accounts.AccountManager;
-import android.accounts.AccountManagerCallback;
-import android.accounts.AccountManagerFuture;
-import android.accounts.AuthenticatorException;
-import android.accounts.OperationCanceledException;
-import android.app.Activity;
-import android.app.ActivityOptions;
-import android.app.Fragment;
-import android.app.FragmentManager;
-import android.content.Context;
-import android.content.Intent;
-import android.content.pm.PackageManager;
-import android.os.Bundle;
-import android.service.persistentdata.PersistentDataBlockManager;
-import android.util.Log;
-
-import com.android.setupwizardlib.util.ResultCodes;
-import com.cyanogenmod.setupwizard.R;
-import com.cyanogenmod.setupwizard.SetupWizardApp;
-import com.cyanogenmod.setupwizard.ui.LoadingFragment;
-import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
-
-import java.io.IOException;
-
-public class GmsAccountPage extends SetupPage {
-
- public static final String TAG = "GmsAccountPage";
-
- public static final String ACTION_RESTORE = "com.google.android.setupwizard.RESTORE";
- public static final String ACTION_PROGRESS = "com.google.android.setupwizard.PROGRESS";
- public static final String ACTION_VENDOR_SETUP = "com.google.android.setupwizard.VENDOR_SETUP";
- public static final String RESTORE_ACTION_ID = "mfm_restore_start";
- public static final String RESTORE_CHECK_ID = "restore_check";
- public static final String FRAGMENT_START_RESTORE =
- "com.google.android.setupwizard.account.StartRestoreFragment";
- public static final String FRAGMENT_CHECK_RESTORE =
- "com.google.android.setupwizard.account.CheckRestoreTokenFragment";
-
- public static final String EXTRA_AUTH_ACCOUNT = "authAccount";
- public static final String EXTRA_RESTORE_ACCOUNT = "restoreAccount";
- public static final String EXTRA_RESTORE_TOKEN = "restoreToken";
-
- private static final String RESTORE_WIZARD_SCRIPT =
- "android.resource://com.google.android.setupwizard/xml/wizard_script";
-
- private Fragment mFragment;
-
- public GmsAccountPage(final Context context, SetupDataCallbacks callbacks) {
- super(context, callbacks);
- }
-
- @Override
- public Fragment getFragment(FragmentManager fragmentManager, int action) {
- mFragment = fragmentManager.findFragmentByTag(getKey());
- if (mFragment == null) {
- Bundle args = new Bundle();
- args.putString(Page.KEY_PAGE_ARGUMENT, getKey());
- args.putInt(Page.KEY_PAGE_ACTION, action);
- mFragment = new LoadingFragment();
- mFragment.setArguments(args);
- }
- return mFragment;
- }
-
- @Override
- public String getKey() {
- return TAG;
- }
-
- @Override
- public int getTitleResId() {
- return R.string.loading;
- }
-
- @Override
- public int getIconResId() {
- return -1;
- }
-
- @Override
- public int getNextButtonTitleResId() {
- return R.string.skip;
- }
-
- @Override
- public void doLoadAction(FragmentManager fragmentManager, int action) {
- if (action == Page.ACTION_PREVIOUS) {
- getCallbacks().onPreviousPage();
- } else {
- super.doLoadAction(fragmentManager, action);
- if (!SetupWizardUtils.isNetworkConnected(mContext) && !SetupWizardUtils.frpEnabled(mContext)) {
- if (SetupWizardApp.DEBUG) {
- Log.d(TAG, "No network, no FRP enforcement, skip GMS account");
- }
- getCallbacks().onNextPage();
- } else if (!SetupWizardUtils.accountExists(mContext, SetupWizardApp.ACCOUNT_TYPE_GMS)) {
- launchGmsAccountSetup();
- } else {
- // This can happen if the user goes from setup -> restore, but chooses to set
- // their device up as "new". Thus we need to not re-prompt this entire flow,
- // skip ahead. CYNGNOS-2459
- if (SetupWizardApp.DEBUG) {
- Log.d(TAG, "Google account already setup, skip gms setup");
- }
- setHidden(true);
- getCallbacks().onNextPage();
- }
- }
- }
-
- @Override
- public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
- if (SetupWizardApp.DEBUG) {
- Log.d(TAG, "Received activity result from requestCode " + requestCode
- + " with a resultCode of " + resultCode);
- if (data != null) {
- Bundle extras = data.getExtras();
- Log.d(TAG, "Within the activity result there were extras:");
- for (String extra : extras.keySet()) {
- Log.d(TAG, "The key " + extra + " has a value of " + extras.get(extra));
- }
- }
- }
- if (requestCode == SetupWizardApp.REQUEST_CODE_SETUP_GMS &&
- resultCode == ResultCodes.RESULT_SKIP) {
- launchGmsVendorSetup();
- } else if (requestCode == SetupWizardApp.REQUEST_CODE_SETUP_GMS && data != null) {
- if (SetupWizardUtils.isOwner() && resultCode == Activity.RESULT_OK) {
-
- // If we don't have a restore token and a restore account, then we need to
- // prompt with the restore picker from googles setup wizard so the user
- // can select what device they would like to restore from. Otherwise,
- // we're coming from a Tap&Go scenario and we should just restore.
- boolean restorePicker = !data.hasExtra(EXTRA_RESTORE_TOKEN)
- && !data.hasExtra(EXTRA_RESTORE_ACCOUNT) &&
- data.hasExtra(EXTRA_AUTH_ACCOUNT);
-
- launchGmsRestorePage(restorePicker);
- } else {
- handleResult(requestCode, resultCode);
- }
- } else {
- if (requestCode == SetupWizardApp.REQUEST_CODE_RESTORE_GMS) {
- setHidden(true);
- }
- handleResult(requestCode, resultCode);
- }
- return true;
- }
-
- @Override
- public boolean doNextAction() {
- final boolean canSkip = canSkip();
- // return true to force this page to handle the next action.
- return !canSkip;
- }
-
- @Override
- public void onFinishSetup() {
-
- }
-
- private void handleResult(int requestCode, int resultCode) {
- if (resultCode == Activity.RESULT_CANCELED) {
- getCallbacks().onPreviousPage();
- } else {
- if (resultCode == Activity.RESULT_OK) {
- getCallbacks().onNextPage();
- } else {
- if (canSkip()) {
- getCallbacks().onNextPage();
- } else {
- getCallbacks().onPreviousPage();
- }
- }
- if (SetupWizardUtils.accountExists(mContext, SetupWizardApp.ACCOUNT_TYPE_GMS)) {
- setHidden(true);
- }
- }
- }
-
- private void launchGmsRestorePage(boolean restorePicker) {
- if (SetupWizardApp.DEBUG) {
- Log.d(TAG, "Launching gms restore page with restorePicker " + restorePicker);
- }
- try {
- // GMS can disable this after logging in sometimes
- if (SetupWizardUtils.enableGMSSetupWizard(mContext)) {
- Intent intent = new Intent(ACTION_PROGRESS);
- if (!restorePicker) {
- intent.setAction(ACTION_PROGRESS);
- intent.putExtra(SetupWizardApp.EXTRA_FRAGMENT, FRAGMENT_START_RESTORE);
- intent.putExtra(SetupWizardApp.EXTRA_ACTION_ID, RESTORE_ACTION_ID);
- } else {
- intent.setAction(ACTION_PROGRESS);
- intent.putExtra(SetupWizardApp.EXTRA_ACTION_ID, RESTORE_CHECK_ID);
- intent.putExtra(SetupWizardApp.EXTRA_FRAGMENT, FRAGMENT_CHECK_RESTORE);
- }
- intent.putExtra(SetupWizardApp.EXTRA_ALLOW_SKIP, true);
- intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true);
- intent.putExtra(SetupWizardApp.EXTRA_FIRST_RUN, true);
- intent.putExtra(SetupWizardApp.EXTRA_THEME, SetupWizardApp.EXTRA_MATERIAL_LIGHT);
- // XXX: Fool G's setup wizard into thinking it is their setup wizard.
- // This is necessary to get the material theme on the restore page.
- intent.putExtra("scriptUri", RESTORE_WIZARD_SCRIPT);
- ActivityOptions options =
- ActivityOptions.makeCustomAnimation(mContext,
- android.R.anim.fade_in,
- android.R.anim.fade_out);
- mFragment.startActivityForResult(
- intent,
- SetupWizardApp.REQUEST_CODE_RESTORE_GMS, options.toBundle());
- return;
- }
- } catch (Exception e) {
- e.printStackTrace();
- // XXX: In open source, we don't know what gms version a user has.
- // Bail if the restore activity is not found.
- getCallbacks().onNextPage();
- }
- }
-
- private void launchGmsVendorSetup() {
- if (SetupWizardApp.DEBUG) {
- Log.d(TAG, "Launching gms vendor setup page");
- }
- try {
- Intent intent = new Intent(ACTION_VENDOR_SETUP);
- intent.setPackage(SetupWizardUtils.GOOGLE_SETUPWIZARD_PACKAGE);
- intent.putExtra(SetupWizardApp.EXTRA_ALLOW_SKIP, true);
- intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true);
- intent.putExtra(SetupWizardApp.EXTRA_FIRST_RUN, true);
- intent.putExtra(SetupWizardApp.EXTRA_THEME, SetupWizardApp.EXTRA_MATERIAL_LIGHT);
- ActivityOptions options =
- ActivityOptions.makeCustomAnimation(mContext,
- android.R.anim.fade_in,
- android.R.anim.fade_out);
- mFragment.startActivityForResult(
- intent,
- SetupWizardApp.REQUEST_CODE_VENDOR_SETUP_GMS, options.toBundle());
- return;
- } catch (Exception e) {
- // Move on if the vendor setup activity is not found.
- getCallbacks().onNextPage();
- }
- }
-
- public boolean canSkip() {
- final PersistentDataBlockManager pdbManager = (PersistentDataBlockManager)
- mContext.getSystemService(Context.PERSISTENT_DATA_BLOCK_SERVICE);
- return pdbManager == null
- || pdbManager.getDataBlockSize() == 0
- || pdbManager.getOemUnlockEnabled();
- }
-
- private void launchGmsAccountSetup() {
- if (SetupWizardApp.DEBUG) {
- Log.d(TAG, "Launching gms account page");
- }
- Bundle bundle = new Bundle();
- bundle.putBoolean(SetupWizardApp.EXTRA_FIRST_RUN, true);
- bundle.putBoolean(SetupWizardApp.EXTRA_ALLOW_SKIP, true);
- bundle.putBoolean(SetupWizardApp.EXTRA_USE_IMMERSIVE, true);
- bundle.putBoolean(SetupWizardApp.EXTRA_SUPRESS_D2D_SETUP, true);
-
- AccountManager
- .get(mContext).addAccount(SetupWizardApp.ACCOUNT_TYPE_GMS, null, null,
- bundle, null, new AccountManagerCallback<Bundle>() {
- @Override
- public void run(AccountManagerFuture<Bundle> future) {
- boolean error = false;
- try {
- Bundle result = future.getResult();
- Intent intent = result
- .getParcelable(AccountManager.KEY_INTENT);
- ActivityOptions options =
- ActivityOptions.makeCustomAnimation(mContext,
- android.R.anim.fade_in,
- android.R.anim.fade_out);
- mFragment.startActivityForResult(intent,
- SetupWizardApp.REQUEST_CODE_SETUP_GMS, options.toBundle());
- } catch (OperationCanceledException e) {
- error = true;
- } catch (IOException e) {
- error = true;
- } catch (AuthenticatorException e) {
- Log.e(TAG, "Error launching gms account", e);
- error = true;
- } finally {
- if (error && getCallbacks().
- isCurrentPage(GmsAccountPage.this)) {
- if (canSkip()) {
- getCallbacks().onNextPage();
- } else {
- getCallbacks().onPreviousPage();
- }
- }
- }
- }
- }, null);
- }
-}
diff --git a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
index 6cc651a..c027c06 100644
--- a/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
+++ b/src/com/cyanogenmod/setupwizard/ui/SetupWizardActivity.java
@@ -46,7 +46,6 @@ import com.android.setupwizardlib.util.SystemBarHelper;
import com.cyanogenmod.setupwizard.R;
import com.cyanogenmod.setupwizard.SetupWizardApp;
import com.cyanogenmod.setupwizard.setup.CMSetupWizardData;
-import com.cyanogenmod.setupwizard.setup.GmsAccountPage;
import com.cyanogenmod.setupwizard.setup.Page;
import com.cyanogenmod.setupwizard.setup.SetupDataCallbacks;
import com.cyanogenmod.setupwizard.util.EnableAccessibilityController;
@@ -143,14 +142,6 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
Settings.Secure.BACKUP_AUTO_RESTORE, 0) == 1) ||
(Settings.Secure.getInt(getContentResolver(),
Settings.Secure.BACKUP_ENABLED, 0) == 1);
- if (TextUtils.equals(lastPage, GmsAccountPage.TAG) && backupEnabled) {
- // We probably already restored, skip ahead!
- mSetupData.setCurrentPage(mSetupData.getNextPage(lastPage).getKey());
- } else {
- // else just restore
- mSetupData.setCurrentPage(sharedPreferences.getString(KEY_LAST_PAGE_TAG,
- mSetupData.getCurrentPage().getKey()));
- }
Page page = mSetupData.getCurrentPage();
page.doLoadAction(getFragmentManager(), Page.ACTION_NEXT);
}
--
2.9.3

View File

@ -21,6 +21,9 @@ export base;
#ATFWD (Miracast/Wireless Display)
blobs=$blobs"ATFWD-daemon|atfwd.apk";
#Clearkey (DRM)
blobs=$blobs"|libdrmclearkeyplugin.so";
#CNE Core XXX: Breaks radio
#blobs=$blobs"|libcneapiclient.so";

View File

@ -92,6 +92,9 @@ enter "packages/apps/CMParts"
rm -rf src/org/cyanogenmod/cmparts/cmstats/ res/xml/anonymous_stats.xml res/xml/preview_data.xml #Nuke part of CMStats
patch -p1 < $patches"android_packages_apps_CMParts/0001-Remove_Analytics.patch" #Remove the rest of CMStats
enter "packages/apps/SetupWizard"
patch -p1 < $patches"android_packages_apps_SetupWizard/0001-No_GMS.patch" #Disable GMS pages
enter "frameworks/base"
git revert 2aaa0472da8d254da1f07aa65a664012b52410f4 #re-enable doze on devices without gms
patch -p1 < $patches"android_frameworks_base/0003-Signature_Spoofing.patch" #Allow packages to spoof their signature (MicroG)