Themes: Refactor themes to CMSDK [6/6]

Change-Id: I26214e9a71f4d2f5f1b61cf3cabdcdb8bcc098b1
TICKET: CYNGNOS-2126
This commit is contained in:
d34d 2016-02-24 15:48:56 -08:00 committed by Clark Scheff
parent ca63326151
commit 8104310592
3 changed files with 7 additions and 8 deletions

View File

@ -37,7 +37,7 @@
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" /> <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-permission android:name="android.permission.MANAGE_USERS" /> <uses-permission android:name="android.permission.MANAGE_USERS" />
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" /> <uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE" />
<uses-permission android:name="android.permission.ACCESS_THEME_MANAGER"/> <uses-permission android:name="cyanogenmod.permission.ACCESS_THEME_MANAGER"/>
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" /> <uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
<uses-permission android:name="cyanogenmod.permission.HARDWARE_ABSTRACTION_ACCESS" /> <uses-permission android:name="cyanogenmod.permission.HARDWARE_ABSTRACTION_ACCESS" />
<uses-permission android:name="android.permission.BACKUP" /> <uses-permission android:name="android.permission.BACKUP" />

View File

@ -22,7 +22,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.ThemeConfig; import android.content.res.ThemeConfig;
import android.content.res.ThemeManager;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.RemoteException; import android.os.RemoteException;
@ -49,6 +48,7 @@ import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
import cyanogenmod.hardware.CMHardwareManager; import cyanogenmod.hardware.CMHardwareManager;
import cyanogenmod.providers.CMSettings; import cyanogenmod.providers.CMSettings;
import cyanogenmod.themes.ThemeManager;
public class CyanogenSettingsPage extends SetupPage { public class CyanogenSettingsPage extends SetupPage {
@ -148,7 +148,7 @@ public class CyanogenSettingsPage extends SetupPage {
SetupStats.Label.CHECKED, SetupStats.Label.CHECKED,
String.valueOf(privacyData.getBoolean(KEY_APPLY_DEFAULT_THEME))); String.valueOf(privacyData.getBoolean(KEY_APPLY_DEFAULT_THEME)));
Log.i(TAG, "Applying default theme"); Log.i(TAG, "Applying default theme");
final ThemeManager tm = (ThemeManager) mContext.getSystemService(Context.THEME_SERVICE); final ThemeManager tm = ThemeManager.getInstance();
tm.applyDefaultTheme(); tm.applyDefaultTheme();
} else { } else {

View File

@ -19,11 +19,9 @@ package com.cyanogenmod.setupwizard.ui;
import android.animation.Animator; import android.animation.Animator;
import android.app.Activity; import android.app.Activity;
import android.app.WallpaperManager; import android.app.WallpaperManager;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.content.res.Resources; import android.content.res.Resources;
import android.content.res.ThemeManager;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.Point; import android.graphics.Point;
import android.os.AsyncTask; import android.os.AsyncTask;
@ -49,6 +47,8 @@ import com.cyanogenmod.setupwizard.setup.SetupDataCallbacks;
import com.cyanogenmod.setupwizard.util.EnableAccessibilityController; import com.cyanogenmod.setupwizard.util.EnableAccessibilityController;
import com.cyanogenmod.setupwizard.util.SetupWizardUtils; import com.cyanogenmod.setupwizard.util.SetupWizardUtils;
import cyanogenmod.themes.ThemeManager;
import java.util.ArrayList; import java.util.ArrayList;
@ -317,7 +317,7 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
mFinishingProgressBar.setVisibility(View.VISIBLE); mFinishingProgressBar.setVisibility(View.VISIBLE);
mFinishingProgressBar.setIndeterminate(true); mFinishingProgressBar.setIndeterminate(true);
mFinishingProgressBar.startAnimation(fadeIn); mFinishingProgressBar.startAnimation(fadeIn);
final ThemeManager tm = (ThemeManager) getSystemService(Context.THEME_SERVICE); final ThemeManager tm = ThemeManager.getInstance();
tm.addClient(this); tm.addClient(this);
mSetupData.finishPages(); mSetupData.finishPages();
} }
@ -433,8 +433,7 @@ public class SetupWizardActivity extends Activity implements SetupDataCallbacks,
if (mEnableAccessibilityController != null) { if (mEnableAccessibilityController != null) {
mEnableAccessibilityController.onDestroy(); mEnableAccessibilityController.onDestroy();
} }
final ThemeManager tm = final ThemeManager tm = ThemeManager.getInstance();
(ThemeManager) SetupWizardActivity.this.getSystemService(THEME_SERVICE);
tm.removeClient(SetupWizardActivity.this); tm.removeClient(SetupWizardActivity.this);
SetupStats.sendEvents(SetupWizardActivity.this); SetupStats.sendEvents(SetupWizardActivity.this);
SetupWizardUtils.disableGMSSetupWizard(SetupWizardActivity.this); SetupWizardUtils.disableGMSSetupWizard(SetupWizardActivity.this);