From d002a0a96eb857804b3aafbcd32cf66a378c5b6c Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Mon, 5 Jun 2017 22:44:37 +0100 Subject: Remove unused variable 'screenon' Test: make Change-Id: I341ef164b2e56a774b531aff7020c82aa69d1157 --- .../systemui/statusbar/phone/NavigationBarFragment.java | 15 ++++++--------- .../systemui/statusbar/phone/NavigationBarView.java | 4 +--- .../com/android/systemui/statusbar/phone/StatusBar.java | 4 ---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java index 85ce0d596771..fbad937d8481 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java @@ -45,7 +45,6 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; -import android.os.PowerManager; import android.os.RemoteException; import android.os.UserHandle; import android.provider.Settings; @@ -202,8 +201,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks { IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF); filter.addAction(Intent.ACTION_SCREEN_ON); getContext().registerReceiverAsUser(mBroadcastReceiver, UserHandle.ALL, filter, null, null); - PowerManager pm = getContext().getSystemService(PowerManager.class); - notifyNavigationBarScreenOn(pm.isScreenOn()); + notifyNavigationBarScreenOn(); } @Override @@ -378,8 +376,8 @@ public class NavigationBarFragment extends Fragment implements Callbacks { ((View) mNavigationBarView.getParent()).getLayoutParams()); } - private void notifyNavigationBarScreenOn(boolean screenOn) { - mNavigationBarView.notifyScreenOn(screenOn); + private void notifyNavigationBarScreenOn() { + mNavigationBarView.notifyScreenOn(); } private void prepareNavigationBarView() { @@ -659,10 +657,9 @@ public class NavigationBarFragment extends Fragment implements Callbacks { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); - if (Intent.ACTION_SCREEN_OFF.equals(action)) { - notifyNavigationBarScreenOn(false); - } else if (Intent.ACTION_SCREEN_ON.equals(action)) { - notifyNavigationBarScreenOn(true); + if (Intent.ACTION_SCREEN_OFF.equals(action) + || Intent.ACTION_SCREEN_ON.equals(action)) { + notifyNavigationBarScreenOn(); } } }; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 523955dba708..cb3222d6d287 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -74,7 +74,6 @@ public class NavigationBarView extends FrameLayout implements PluginListener