/*
 * Copyright 2014 Prateek Srivastava (@f2prateek)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.f2prateek.dfg.util;

import android.os.Environment;
import com.f2prateek.ln.Ln;

public class StorageUtils {

  /**
   * Checks if storage is available for our use.
   *
   * @return true if storage is available and writeable
   */
  @SuppressWarnings("BooleanMethodIsAlwaysInverted") public static boolean isStorageAvailable() {
    boolean mExternalStorageAvailable;
    boolean mExternalStorageWriteable;
    String state = Environment.getExternalStorageState();

    if (Environment.MEDIA_MOUNTED.equals(state)) {
      // We can read and write the media
      mExternalStorageAvailable = mExternalStorageWriteable = true;
    } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
      // We can only read the media
      mExternalStorageAvailable = true;
      mExternalStorageWriteable = false;
    } else {
      // Something else is wrong. It may be one of many other states, but
      // all we need to know is we can neither read nor write
      mExternalStorageAvailable = mExternalStorageWriteable = false;
    }

    Ln.i(mExternalStorageAvailable ? "Storage available" : "Storage Unavailable");
    Ln.i(mExternalStorageWriteable ? "Storage writeable" : "Storage not writeable");

    return (mExternalStorageAvailable && mExternalStorageWriteable);
  }
}

@@ -953,34 +953,33 @@
 ) %7B%0A    boolean 
-mE
+e
 xternalStorageAv
@@ -999,18 +999,17 @@
 boolean 
-mE
+e
 xternalS
@@ -1174,34 +1174,33 @@
 the media%0A      
-mE
+e
 xternalStorageAv
@@ -1201,34 +1201,33 @@
 rageAvailable = 
-mE
+e
 xternalStorageWr
@@ -1348,26 +1348,25 @@
 media%0A      
-mE
+e
 xternalStora
@@ -1387,26 +1387,25 @@
 true;%0A      
-mE
+e
 xternalStora
@@ -1580,18 +1580,17 @@
 e%0A      
-mE
+e
 xternalS
@@ -1607,18 +1607,17 @@
 lable = 
-mE
+e
 xternalS
@@ -1649,34 +1649,33 @@
     %7D%0A%0A    Ln.i(
-mE
+e
 xternalStorageAv
@@ -1739,18 +1739,17 @@
    Ln.i(
-mE
+e
 xternalS
@@ -1827,18 +1827,17 @@
 return (
-mE
+e
 xternalS
@@ -1859,10 +1859,9 @@
  && 
-mE
+e
 xter

Rename variable