Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardTouchDelegate.java +24 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.phone; package com.android.systemui.statusbar.phone; import com.google.android.collect.Lists; import android.content.ComponentName; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; Loading @@ -28,6 +30,8 @@ import android.view.MotionEvent; import com.android.internal.policy.IKeyguardService; import com.android.internal.policy.IKeyguardService; import java.util.List; /** /** * Facilitates event communication between navigation bar and keyguard. Currently used to * Facilitates event communication between navigation bar and keyguard. Currently used to Loading @@ -40,6 +44,8 @@ public class KeyguardTouchDelegate { static final String KEYGUARD_CLASS = "com.android.keyguard.KeyguardService"; static final String KEYGUARD_CLASS = "com.android.keyguard.KeyguardService"; private static KeyguardTouchDelegate sInstance; private static KeyguardTouchDelegate sInstance; private static final List<OnKeyguardConnectionListener> sConnectionListeners = Lists.newArrayList(); private volatile IKeyguardService mService; private volatile IKeyguardService mService; Loading @@ -52,6 +58,10 @@ public class KeyguardTouchDelegate { Slog.v(TAG, "Connected to keyguard"); Slog.v(TAG, "Connected to keyguard"); mService = IKeyguardService.Stub.asInterface(service); mService = IKeyguardService.Stub.asInterface(service); for (int i = 0; i < sConnectionListeners.size(); i++) { OnKeyguardConnectionListener listener = sConnectionListeners.get(i); listener.onKeyguardServiceConnected(KeyguardTouchDelegate.this); } } } @Override @Override Loading @@ -59,6 +69,11 @@ public class KeyguardTouchDelegate { Slog.v(TAG, "Disconnected from keyguard"); Slog.v(TAG, "Disconnected from keyguard"); mService = null; mService = null; sInstance = null; // force reconnection if this goes away sInstance = null; // force reconnection if this goes away for (int i = 0; i < sConnectionListeners.size(); i++) { OnKeyguardConnectionListener listener = sConnectionListeners.get(i); listener.onKeyguardServiceDisconnected(KeyguardTouchDelegate.this); } } } }; }; Loading Loading @@ -182,4 +197,13 @@ public class KeyguardTouchDelegate { } } } } public static void addListener(OnKeyguardConnectionListener listener) { sConnectionListeners.add(listener); } public interface OnKeyguardConnectionListener { void onKeyguardServiceConnected(KeyguardTouchDelegate keyguardTouchDelegate); void onKeyguardServiceDisconnected(KeyguardTouchDelegate keyguardTouchDelegate); } } } packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +22 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,8 @@ import com.android.systemui.statusbar.policy.KeyButtonView; import java.io.FileDescriptor; import java.io.FileDescriptor; import java.io.PrintWriter; import java.io.PrintWriter; import static com.android.systemui.statusbar.phone.KeyguardTouchDelegate.OnKeyguardConnectionListener; public class NavigationBarView extends LinearLayout { public class NavigationBarView extends LinearLayout { final static boolean DEBUG = false; final static boolean DEBUG = false; final static String TAG = "PhoneStatusBar/NavigationBarView"; final static String TAG = "PhoneStatusBar/NavigationBarView"; Loading Loading @@ -172,6 +174,25 @@ public class NavigationBarView extends LinearLayout { } } }; }; private final OnKeyguardConnectionListener mKeyguardConnectionListener = new OnKeyguardConnectionListener() { @Override public void onKeyguardServiceConnected( KeyguardTouchDelegate keyguardTouchDelegate) { post(new Runnable() { @Override public void run() { mCameraDisabledByDpm = isCameraDisabledByDpm(); } }); } @Override public void onKeyguardServiceDisconnected( KeyguardTouchDelegate keyguardTouchDelegate) { } }; private class H extends Handler { private class H extends Handler { public void handleMessage(Message m) { public void handleMessage(Message m) { switch (m.what) { switch (m.what) { Loading Loading @@ -211,6 +232,7 @@ public class NavigationBarView extends LinearLayout { mBarTransitions = new NavigationBarTransitions(this); mBarTransitions = new NavigationBarTransitions(this); KeyguardTouchDelegate.addListener(mKeyguardConnectionListener); mCameraDisabledByDpm = isCameraDisabledByDpm(); mCameraDisabledByDpm = isCameraDisabledByDpm(); watchForDevicePolicyChanges(); watchForDevicePolicyChanges(); } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardTouchDelegate.java +24 −0 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.phone; package com.android.systemui.statusbar.phone; import com.google.android.collect.Lists; import android.content.ComponentName; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.Intent; Loading @@ -28,6 +30,8 @@ import android.view.MotionEvent; import com.android.internal.policy.IKeyguardService; import com.android.internal.policy.IKeyguardService; import java.util.List; /** /** * Facilitates event communication between navigation bar and keyguard. Currently used to * Facilitates event communication between navigation bar and keyguard. Currently used to Loading @@ -40,6 +44,8 @@ public class KeyguardTouchDelegate { static final String KEYGUARD_CLASS = "com.android.keyguard.KeyguardService"; static final String KEYGUARD_CLASS = "com.android.keyguard.KeyguardService"; private static KeyguardTouchDelegate sInstance; private static KeyguardTouchDelegate sInstance; private static final List<OnKeyguardConnectionListener> sConnectionListeners = Lists.newArrayList(); private volatile IKeyguardService mService; private volatile IKeyguardService mService; Loading @@ -52,6 +58,10 @@ public class KeyguardTouchDelegate { Slog.v(TAG, "Connected to keyguard"); Slog.v(TAG, "Connected to keyguard"); mService = IKeyguardService.Stub.asInterface(service); mService = IKeyguardService.Stub.asInterface(service); for (int i = 0; i < sConnectionListeners.size(); i++) { OnKeyguardConnectionListener listener = sConnectionListeners.get(i); listener.onKeyguardServiceConnected(KeyguardTouchDelegate.this); } } } @Override @Override Loading @@ -59,6 +69,11 @@ public class KeyguardTouchDelegate { Slog.v(TAG, "Disconnected from keyguard"); Slog.v(TAG, "Disconnected from keyguard"); mService = null; mService = null; sInstance = null; // force reconnection if this goes away sInstance = null; // force reconnection if this goes away for (int i = 0; i < sConnectionListeners.size(); i++) { OnKeyguardConnectionListener listener = sConnectionListeners.get(i); listener.onKeyguardServiceDisconnected(KeyguardTouchDelegate.this); } } } }; }; Loading Loading @@ -182,4 +197,13 @@ public class KeyguardTouchDelegate { } } } } public static void addListener(OnKeyguardConnectionListener listener) { sConnectionListeners.add(listener); } public interface OnKeyguardConnectionListener { void onKeyguardServiceConnected(KeyguardTouchDelegate keyguardTouchDelegate); void onKeyguardServiceDisconnected(KeyguardTouchDelegate keyguardTouchDelegate); } } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +22 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,8 @@ import com.android.systemui.statusbar.policy.KeyButtonView; import java.io.FileDescriptor; import java.io.FileDescriptor; import java.io.PrintWriter; import java.io.PrintWriter; import static com.android.systemui.statusbar.phone.KeyguardTouchDelegate.OnKeyguardConnectionListener; public class NavigationBarView extends LinearLayout { public class NavigationBarView extends LinearLayout { final static boolean DEBUG = false; final static boolean DEBUG = false; final static String TAG = "PhoneStatusBar/NavigationBarView"; final static String TAG = "PhoneStatusBar/NavigationBarView"; Loading Loading @@ -172,6 +174,25 @@ public class NavigationBarView extends LinearLayout { } } }; }; private final OnKeyguardConnectionListener mKeyguardConnectionListener = new OnKeyguardConnectionListener() { @Override public void onKeyguardServiceConnected( KeyguardTouchDelegate keyguardTouchDelegate) { post(new Runnable() { @Override public void run() { mCameraDisabledByDpm = isCameraDisabledByDpm(); } }); } @Override public void onKeyguardServiceDisconnected( KeyguardTouchDelegate keyguardTouchDelegate) { } }; private class H extends Handler { private class H extends Handler { public void handleMessage(Message m) { public void handleMessage(Message m) { switch (m.what) { switch (m.what) { Loading Loading @@ -211,6 +232,7 @@ public class NavigationBarView extends LinearLayout { mBarTransitions = new NavigationBarTransitions(this); mBarTransitions = new NavigationBarTransitions(this); KeyguardTouchDelegate.addListener(mKeyguardConnectionListener); mCameraDisabledByDpm = isCameraDisabledByDpm(); mCameraDisabledByDpm = isCameraDisabledByDpm(); watchForDevicePolicyChanges(); watchForDevicePolicyChanges(); } } Loading