Skip to content

Commit

Permalink
Android: Moves isPrintingSupported method to ApiCompatibilityUtils
Browse files Browse the repository at this point in the history
PrintingControllerImpl uses new KitKat APIs, so it causes problems with
ICS bots.

BUG=321751

Review URL: https://codereview.chromium.org/83263003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236773 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
cimamoglu@chromium.org committed Nov 22, 2013
1 parent 3b88087 commit b8257e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public static boolean isLayoutRtl(View view) {
}
}

/**
* @return True if the running version of the Android supports printing.
*/
public static boolean isPrintingSupported() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
}

/**
* @see android.view.View#setLayoutDirection(int)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.content.Context;
import android.print.PrintManager;

import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.chrome.R;
import org.chromium.printing.PrintManagerDelegateImpl;
import org.chromium.printing.PrintingController;
Expand All @@ -20,7 +21,7 @@
*/
public class PrintingControllerFactory {
public static PrintingController create(Activity activity) {
if (PrintingControllerImpl.isPrintingSupported()) {
if (ApiCompatibilityUtils.isPrintingSupported()) {
String defaultJobTitle = activity.getResources().getString(R.string.menu_print);
TabPrinter.setDefaultTitle(defaultJobTitle);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import org.chromium.base.ThreadUtils;

import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
Expand Down Expand Up @@ -126,14 +124,6 @@ public static PrintingController getInstance() {
return sInstance;
}

/**
* @return True if the running version of the Android supports printing.
*/
@SuppressLint("InlinedApi")
public static boolean isPrintingSupported() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
}

@Override
public boolean hasPrintingFinished() {
return mPrintingState == PRINTING_STATE_FINISHED;
Expand Down

0 comments on commit b8257e6

Please sign in to comment.