Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/Desktop.java

Issue 273313003: Fix lint issues with Chromoting for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/android/java/src/org/chromium/chromoting/Desktop.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
index e4a8d0c8beabeca820e89875e522331c66e75ca7..0f44e24a0564be80dcce8384784354898d55ff47 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
@@ -4,6 +4,7 @@
package org.chromium.chromoting;
+import android.annotation.TargetApi;
import android.app.Activity;
import android.content.res.Configuration;
import android.os.Build;
@@ -79,10 +80,7 @@ public class Desktop extends Activity implements View.OnSystemUiVisibilityChange
// IMMERSIVE_STICKY mode is used, the system clears this flag (leaving the FULLSCREEN flag
// set) when the user swipes the edge to reveal the bars temporarily. When this happens,
// the action-bar should remain hidden.
- int fullscreenFlags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- fullscreenFlags |= View.SYSTEM_UI_FLAG_FULLSCREEN;
- }
+ int fullscreenFlags = getSystemUiFlags();
if ((visibility & fullscreenFlags) != 0) {
hideActionBar();
} else {
@@ -90,6 +88,15 @@ public class Desktop extends Activity implements View.OnSystemUiVisibilityChange
}
}
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+ private int getSystemUiFlags() {
+ int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
+ flags |= View.SYSTEM_UI_FLAG_FULLSCREEN;
+ }
+ return flags;
+ }
+
public void showActionBar() {
mOverlayButton.setVisibility(View.INVISIBLE);
getActionBar().show();
@@ -106,10 +113,7 @@ public class Desktop extends Activity implements View.OnSystemUiVisibilityChange
// LOW_PROFILE gives the status and navigation bars a "lights-out" appearance.
// FULLSCREEN hides the status bar on supported devices (4.1 and above).
- int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
- flags |= View.SYSTEM_UI_FLAG_FULLSCREEN;
- }
+ int flags = getSystemUiFlags();
// HIDE_NAVIGATION hides the navigation bar. However, if the user touches the screen, the
// event is not seen by the application and instead the navigation bar is re-shown.

Powered by Google App Engine
This is Rietveld 408576698