SetupWizard: Temporary compile fixes.

Change-Id: Iffdbb3b38aef75f14dcb0957df8dda13f844159b
This commit is contained in:
Adnan Begovic 2015-10-14 12:44:53 -07:00
parent f29f92dcac
commit 307e587a3a
6 changed files with 46 additions and 49 deletions

View File

@ -87,9 +87,7 @@ public class CMSetupWizardData extends AbstractSetupData {
showHideSimMissingPage();
showHideMobileDataPage();
} else if (intent.getAction()
.equals(ConnectivityManager.CONNECTIVITY_ACTION) ||
intent.getAction()
.equals(ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE)) {
.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
showHideMobileDataPage();
showHideAccountPages();
} else if (intent.getAction()
@ -165,7 +163,6 @@ public class CMSetupWizardData extends AbstractSetupData {
filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
filter.addAction(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED);
}
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE);
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
filter.addAction(Intent.ACTION_TIME_CHANGED);

View File

@ -24,9 +24,9 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ThemeUtils;
/*import android.content.pm.ThemeUtils;
import android.content.res.ThemeConfig;
import android.content.res.ThemeManager;
import android.content.res.ThemeManager;*/
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
@ -104,20 +104,20 @@ public class CyanogenSettingsPage extends SetupPage {
private static void writeDisableNavkeysOption(Context context, boolean enabled) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
final int defaultBrightness = context.getResources().getInteger(
com.android.internal.R.integer.config_buttonBrightnessSettingDefault);
/*final int defaultBrightness = context.getResources().getInteger(
com.android.internal.R.integer.config_buttonBrightnessSettingDefault);*/
Settings.Secure.putInt(context.getContentResolver(),
/*Settings.Secure.putInt(context.getContentResolver(),
Settings.Secure.DEV_FORCE_SHOW_NAVBAR, enabled ? 1 : 0);
final CMHardwareManager hardware = CMHardwareManager.getInstance(context);
hardware.set(CMHardwareManager.FEATURE_KEY_DISABLE, enabled);
hardware.set(CMHardwareManager.FEATURE_KEY_DISABLE, enabled);*/
/* Save/restore button timeouts to disable them in softkey mode */
SharedPreferences.Editor editor = prefs.edit();
if (enabled) {
int currentBrightness = CMSettings.Secure.getInt(context.getContentResolver(),
CMSettings.Secure.BUTTON_BRIGHTNESS, defaultBrightness);
CMSettings.Secure.BUTTON_BRIGHTNESS, 100);
if (!prefs.contains("pre_navbar_button_backlight")) {
editor.putInt("pre_navbar_button_backlight", currentBrightness);
}
@ -178,7 +178,7 @@ public class CyanogenSettingsPage extends SetupPage {
}
private void handleDefaultThemeSetup() {
Bundle privacyData = getData();
/*Bundle privacyData = getData();
if (!ThemeUtils.getDefaultThemePackageName(mContext).equals(ThemeConfig.SYSTEM_DEFAULT) &&
privacyData != null && privacyData.getBoolean(KEY_APPLY_DEFAULT_THEME)) {
SetupStats.addEvent(SetupStats.Categories.SETTING_CHANGED,
@ -189,9 +189,9 @@ public class CyanogenSettingsPage extends SetupPage {
final ThemeManager tm = (ThemeManager) mContext.getSystemService(Context.THEME_SERVICE);
tm.applyDefaultTheme();
} else {
} else { */
getCallbacks().finishSetup();
}
//}
}
private static boolean hideKeyDisabler(Context ctx) {
@ -221,9 +221,9 @@ public class CyanogenSettingsPage extends SetupPage {
SetupWizardUtils.isSimMissing(context));
}
private static boolean hideThemeSwitch(Context context) {
/*private static boolean hideThemeSwitch(Context context) {
return ThemeUtils.getDefaultThemePackageName(context).equals(ThemeConfig.SYSTEM_DEFAULT);
}
}*/
public static class CyanogenSettingsFragment extends SetupPageFragment {
@ -333,7 +333,7 @@ public class CyanogenSettingsPage extends SetupPage {
mMetrics = (CheckBox) mRootView.findViewById(R.id.enable_metrics_checkbox);
mDefaultThemeRow = mRootView.findViewById(R.id.theme);
mHideThemeRow = hideThemeSwitch(getActivity());
mHideThemeRow = true; // hideThemeSwitch(getActivity());
if (mHideThemeRow) {
mDefaultThemeRow.setVisibility(View.GONE);
} else {
@ -356,11 +356,11 @@ public class CyanogenSettingsPage extends SetupPage {
mNavKeysRow.setOnClickListener(mNavKeysClickListener);
mNavKeys = (CheckBox) mRootView.findViewById(R.id.nav_keys_checkbox);
boolean needsNavBar = true;
try {
/*try {
IWindowManager windowManager = WindowManagerGlobal.getWindowManagerService();
needsNavBar = windowManager.needsNavigationBar();
} catch (RemoteException e) {
}
}*/
mHideNavKeysRow = hideKeyDisabler(getActivity());
if (mHideNavKeysRow || needsNavBar) {
mNavKeysRow.setVisibility(View.GONE);
@ -396,7 +396,7 @@ public class CyanogenSettingsPage extends SetupPage {
@Override
public void onResume() {
super.onResume();
updateDisableNavkeysOption();
/*updateDisableNavkeysOption();*/
updateMetricsOption();
updateThemeOption();
updateSmsOption();
@ -437,7 +437,7 @@ public class CyanogenSettingsPage extends SetupPage {
}
}
private void updateDisableNavkeysOption() {
/*private void updateDisableNavkeysOption() {
if (!mHideNavKeysRow) {
final Bundle myPageBundle = mPage.getData();
boolean enabled = Settings.Secure.getInt(getActivity().getContentResolver(),
@ -448,7 +448,7 @@ public class CyanogenSettingsPage extends SetupPage {
mNavKeys.setChecked(checked);
myPageBundle.putBoolean(KEY_ENABLE_NAV_KEYS, checked);
}
}
}*/
private static boolean hideKillSwitch() {
return !SetupWizardUtils.hasKillSwitch();

View File

@ -104,7 +104,7 @@ public class FingerprintSetupPage extends SetupPage {
intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true);
intent.putExtra(SetupWizardApp.EXTRA_THEME, SetupWizardApp.EXTRA_MATERIAL_LIGHT);
intent.putExtra(SetupWizardApp.EXTRA_AUTO_FINISH, false);
intent.putExtra(LockPatternUtils.LOCKSCREEN_FINGERPRINT_FALLBACK, true);
/*intent.putExtra(LockPatternUtils.LOCKSCREEN_FINGERPRINT_FALLBACK, true);*/
intent.putExtra(SetupWizardApp.EXTRA_TITLE,
getString(R.string.settings_fingerprint_setup_title));
intent.putExtra(SetupWizardApp.EXTRA_DETAILS,

View File

@ -73,12 +73,12 @@ public class GmsAccountPage extends SetupPage {
Settings.Secure.BACKUP_ENABLED, 0) == 1);
}
};
Cursor settingsCursor = res.query(Settings.Secure.CONTENT_URI, null,
"(" + Settings.System.NAME + "=? OR " + Settings.System.NAME + "=?)",
new String[]{Settings.Secure.BACKUP_AUTO_RESTORE, Settings.Secure.BACKUP_ENABLED},
null);
mContentQueryMap = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, null);
mContentQueryMap.addObserver(mSettingsObserver);
//Cursor settingsCursor = res.query(Settings.Secure.CONTENT_URI, null,
// "(" + Settings.System.NAME + "=? OR " + Settings.System.NAME + "=?)",
// new String[]{Settings.Secure.BACKUP_AUTO_RESTORE, Settings.Secure.BACKUP_ENABLED},
// null);
//mContentQueryMap = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, null);
//mContentQueryMap.addObserver(mSettingsObserver);
}
@Override

View File

@ -23,7 +23,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.content.res.ThemeManager;
/*import android.content.res.ThemeManager;*/
import android.graphics.Bitmap;
import android.graphics.Point;
import android.os.Bundle;
@ -51,8 +51,7 @@ import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
import java.util.ArrayList;
public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
ThemeManager.ThemeChangeListener {
public class SetupWizardActivity extends Activity implements SetupDataCallbacks {
private static final String TAG = SetupWizardActivity.class.getSimpleName();
@ -305,12 +304,12 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
mFinishingProgressBar.setVisibility(View.VISIBLE);
mFinishingProgressBar.setIndeterminate(true);
mFinishingProgressBar.startAnimation(fadeIn);
final ThemeManager tm = (ThemeManager) getSystemService(Context.THEME_SERVICE);
tm.addClient(this);
/*final ThemeManager tm = (ThemeManager) getSystemService(Context.THEME_SERVICE);
tm.addClient(this);*/
mSetupData.finishPages();
}
@Override
/*@Override
public void onFinish(boolean isSuccess) {
if (isResumed()) {
mHandler.post(new Runnable() {
@ -320,15 +319,15 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
}
});
}
}
}*/
@Override
/*@Override
public void onProgress(int progress) {
if (progress > 0) {
mFinishingProgressBar.setIndeterminate(false);
mFinishingProgressBar.setProgress(progress);
}
}
}*/
@Override
public void finishSetup() {
@ -421,9 +420,9 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
if (mEnableAccessibilityController != null) {
mEnableAccessibilityController.onDestroy();
}
final ThemeManager tm =
/*final ThemeManager tm =
(ThemeManager) SetupWizardActivity.this.getSystemService(THEME_SERVICE);
tm.removeClient(SetupWizardActivity.this);
tm.removeClient(SetupWizardActivity.this);*/
SetupStats.sendEvents(SetupWizardActivity.this);
SetupWizardUtils.disableGMSSetupWizard(SetupWizardActivity.this);
Intent intent = new Intent(Intent.ACTION_MAIN);

View File

@ -23,6 +23,7 @@ import android.content.Context;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.hardware.fingerprint.FingerprintManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
@ -36,8 +37,7 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.android.internal.os.IKillSwitchService;
import com.android.internal.widget.LockPatternUtils;
/*import com.android.internal.os.IKillSwitchService;*/
import com.cyanogenmod.setupwizard.SetupWizardApp;
import com.google.android.gms.common.ConnectionResult;
@ -90,7 +90,7 @@ public class SetupWizardUtils {
android.provider.Settings.Global.putInt(context.getContentResolver(),
android.provider.Settings.Global.MOBILE_DATA + phoneId, enabled ? 1 : 0);
int subId = SubscriptionManager.getDefaultDataSubId();
tm.setDataEnabledUsingSubId(subId, enabled);
tm.setDataEnabled(subId, enabled);
} else {
android.provider.Settings.Global.putInt(context.getContentResolver(),
android.provider.Settings.Global.MOBILE_DATA, enabled ? 1 : 0);
@ -131,7 +131,7 @@ public class SetupWizardUtils {
}
public static boolean isDeviceLocked() {
IBinder b = ServiceManager.getService(Context.KILLSWITCH_SERVICE);
/* IBinder b = ServiceManager.getService(Context.KILLSWITCH_SERVICE);
IKillSwitchService service = IKillSwitchService.Stub.asInterface(b);
if (service != null) {
try {
@ -139,7 +139,7 @@ public class SetupWizardUtils {
} catch (Exception e) {
// silently fail
}
}
}*/
return false;
}
@ -152,7 +152,7 @@ public class SetupWizardUtils {
}
public static boolean hasKillSwitch() {
IBinder b = ServiceManager.getService(Context.KILLSWITCH_SERVICE);
/* IBinder b = ServiceManager.getService(Context.KILLSWITCH_SERVICE);
IKillSwitchService service = IKillSwitchService.Stub.asInterface(b);
if (service != null) {
try {
@ -160,7 +160,7 @@ public class SetupWizardUtils {
} catch (Exception e) {
// silently fail
}
}
} */
return false;
}
@ -278,8 +278,9 @@ public class SetupWizardUtils {
}
public static boolean hasFingerprint(Context context) {
LockPatternUtils lockPatternUtils = new LockPatternUtils(context);
return lockPatternUtils.isFingerprintInstalled(context);
FingerprintManager fingerprintManager = (FingerprintManager)
context.getSystemService(Context.FINGERPRINT_SERVICE);
return fingerprintManager.isHardwareDetected();
}
public static final ComponentName mTvwifisettingsActivity =