aboutsummaryrefslogtreecommitdiffstats
path: root/cm/lib
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2015-07-14 00:10:23 +0200
committerAdnan Begovic <adnan@cyngn.com>2015-07-13 16:58:16 -0700
commit63524972a3f3bee41f481648b95b521b4bea6450 (patch)
tree7b954a36a23e143bb6cb16bc81f0d1a84ec1f1e9 /cm/lib
parenteddb89c5278d8a9773af3b2fdc7c2df5d051ba5f (diff)
downloadvendor_cmsdk-63524972a3f3bee41f481648b95b521b4bea6450.zip
vendor_cmsdk-63524972a3f3bee41f481648b95b521b4bea6450.tar.gz
vendor_cmsdk-63524972a3f3bee41f481648b95b521b4bea6450.tar.bz2
cmsdk: fix cannot create handler
Change-Id: I34153f6199d46b7fa9a914efa38552b8d66c0c99 JIRA: NIGHTLIES-1532 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Diffstat (limited to 'cm/lib')
-rw-r--r--cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java5
-rw-r--r--cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileTriggerHelper.java13
2 files changed, 14 insertions, 4 deletions
diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java
index e6f7f8e..a533963 100644
--- a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java
+++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileManagerService.java
@@ -29,6 +29,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.XmlResourceParser;
import android.os.Environment;
+import android.os.Handler;
import android.os.UserHandle;
import android.os.IBinder;
import android.text.TextUtils;
@@ -80,6 +81,7 @@ public class ProfileManagerService extends SystemService {
private NotificationGroup mWildcardGroup;
private Context mContext;
+ private Handler mHandler;
private boolean mDirty;
private BackupManager mBackupManager;
private ProfileTriggerHelper mTriggerHelper;
@@ -100,6 +102,7 @@ public class ProfileManagerService extends SystemService {
public ProfileManagerService(Context context) {
super(context);
mContext = context;
+ mHandler = new Handler();
publishBinderService(CMContextConstants.CM_PROFILE_SERVICE, mService);
}
@@ -125,7 +128,7 @@ public class ProfileManagerService extends SystemService {
}
private void initialize(boolean skipFile) {
- mTriggerHelper = new ProfileTriggerHelper(mContext, this);
+ mTriggerHelper = new ProfileTriggerHelper(mContext, mHandler, this);
mProfiles = new HashMap<UUID, Profile>();
mProfileNames = new HashMap<String, UUID>();
mGroups = new HashMap<UUID, NotificationGroup>();
diff --git a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileTriggerHelper.java b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileTriggerHelper.java
index 2e7e4c4..8ad6098 100644
--- a/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileTriggerHelper.java
+++ b/cm/lib/main/java/org/cyanogenmod/platform/internal/ProfileTriggerHelper.java
@@ -50,16 +50,23 @@ public class ProfileTriggerHelper extends BroadcastReceiver {
private IntentFilter mIntentFilter;
private boolean mFilterRegistered = false;
- private ContentObserver mSettingsObserver = new ContentObserver(new Handler()) {
+ private class SettingsObserver extends ContentObserver {
+ public SettingsObserver(Handler handler) {
+ super(handler);
+ }
+
@Override
public void onChange(boolean selfChange) {
updateEnabled();
}
- };
+ }
+ private final ContentObserver mSettingsObserver;
- public ProfileTriggerHelper(Context context, ProfileManagerService profileManagerService) {
+ public ProfileTriggerHelper(Context context, Handler handler,
+ ProfileManagerService profileManagerService) {
mContext = context;
mManagerService = profileManagerService;
+ mSettingsObserver = new SettingsObserver(handler);
mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
mLastConnectedSSID = getActiveSSID();