From 183cb71663320f16149d83eeebaff7795a4b55f2 Mon Sep 17 00:00:00 2001 From: linyuh Date: Wed, 27 Dec 2017 17:02:37 -0800 Subject: Remove field prefixes. Test: Existing tests PiperOrigin-RevId: 180230450 Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f --- java/com/android/dialer/util/ExpirableCache.java | 32 +++++++++++----------- .../com/android/dialer/util/TouchPointManager.java | 12 ++++---- .../dialer/util/TransactionSafeActivity.java | 12 ++++---- 3 files changed, 28 insertions(+), 28 deletions(-) (limited to 'java/com/android/dialer/util') diff --git a/java/com/android/dialer/util/ExpirableCache.java b/java/com/android/dialer/util/ExpirableCache.java index 2778a572c..a1b0afd74 100644 --- a/java/com/android/dialer/util/ExpirableCache.java +++ b/java/com/android/dialer/util/ExpirableCache.java @@ -98,13 +98,13 @@ public class ExpirableCache { * * @see ExpirableCache.CachedValue#isExpired() */ - private final AtomicInteger mGeneration; + private final AtomicInteger generation; /** The underlying cache used to stored the cached values. */ - private LruCache> mCache; + private LruCache> cache; private ExpirableCache(LruCache> cache) { - mCache = cache; - mGeneration = new AtomicInteger(0); + this.cache = cache; + generation = new AtomicInteger(0); } /** @@ -147,7 +147,7 @@ public class ExpirableCache { * @param key the key to look up */ public CachedValue getCachedValue(K key) { - return mCache.get(key); + return cache.get(key); } /** @@ -190,7 +190,7 @@ public class ExpirableCache { * @param value the value to associate with the key */ public void put(K key, V value) { - mCache.put(key, newCachedValue(value)); + cache.put(key, newCachedValue(value)); } /** @@ -201,7 +201,7 @@ public class ExpirableCache { *

Expiring the items in the cache does not imply they will be evicted. */ public void expireAll() { - mGeneration.incrementAndGet(); + generation.incrementAndGet(); } /** @@ -210,7 +210,7 @@ public class ExpirableCache { *

Implementation of {@link LruCache#create(K)} can use this method to create a new entry. */ public CachedValue newCachedValue(V value) { - return new GenerationalCachedValue(value, mGeneration); + return new GenerationalCachedValue(value, generation); } /** @@ -239,31 +239,31 @@ public class ExpirableCache { private static class GenerationalCachedValue implements ExpirableCache.CachedValue { /** The value stored in the cache. */ - public final V mValue; + public final V value; /** The generation at which the value was added to the cache. */ - private final int mGeneration; + private final int generation; /** The atomic integer storing the current generation of the cache it belongs to. */ - private final AtomicInteger mCacheGeneration; + private final AtomicInteger cacheGeneration; /** * @param cacheGeneration the atomic integer storing the generation of the cache in which this * value will be stored */ public GenerationalCachedValue(V value, AtomicInteger cacheGeneration) { - mValue = value; - mCacheGeneration = cacheGeneration; + this.value = value; + this.cacheGeneration = cacheGeneration; // Snapshot the current generation. - mGeneration = mCacheGeneration.get(); + generation = this.cacheGeneration.get(); } @Override public V getValue() { - return mValue; + return value; } @Override public boolean isExpired() { - return mGeneration != mCacheGeneration.get(); + return generation != cacheGeneration.get(); } } } diff --git a/java/com/android/dialer/util/TouchPointManager.java b/java/com/android/dialer/util/TouchPointManager.java index 0bd7371cc..ad5b00776 100644 --- a/java/com/android/dialer/util/TouchPointManager.java +++ b/java/com/android/dialer/util/TouchPointManager.java @@ -27,23 +27,23 @@ public class TouchPointManager { public static final String TOUCH_POINT = "touchPoint"; - private static TouchPointManager sInstance = new TouchPointManager(); + private static TouchPointManager instance = new TouchPointManager(); - private Point mPoint = new Point(); + private Point point = new Point(); /** Private constructor. Instance should only be acquired through getRunningInstance(). */ private TouchPointManager() {} public static TouchPointManager getInstance() { - return sInstance; + return instance; } public Point getPoint() { - return mPoint; + return point; } public void setPoint(int x, int y) { - mPoint.set(x, y); + point.set(x, y); } /** @@ -55,6 +55,6 @@ public class TouchPointManager { * (0,0). */ public boolean hasValidPoint() { - return mPoint.x != 0 || mPoint.y != 0; + return point.x != 0 || point.y != 0; } } diff --git a/java/com/android/dialer/util/TransactionSafeActivity.java b/java/com/android/dialer/util/TransactionSafeActivity.java index 9b5e92ba8..aa472493b 100644 --- a/java/com/android/dialer/util/TransactionSafeActivity.java +++ b/java/com/android/dialer/util/TransactionSafeActivity.java @@ -25,30 +25,30 @@ import android.support.v7.app.AppCompatActivity; */ public abstract class TransactionSafeActivity extends AppCompatActivity { - private boolean mIsSafeToCommitTransactions; + private boolean isSafeToCommitTransactions; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - mIsSafeToCommitTransactions = true; + isSafeToCommitTransactions = true; } @Override protected void onStart() { super.onStart(); - mIsSafeToCommitTransactions = true; + isSafeToCommitTransactions = true; } @Override protected void onResume() { super.onResume(); - mIsSafeToCommitTransactions = true; + isSafeToCommitTransactions = true; } @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - mIsSafeToCommitTransactions = false; + isSafeToCommitTransactions = false; } /** @@ -59,6 +59,6 @@ public abstract class TransactionSafeActivity extends AppCompatActivity { * outState)} (if that method is overridden), so the flag is properly set. */ public boolean isSafeToCommitTransactions() { - return mIsSafeToCommitTransactions; + return isSafeToCommitTransactions; } } -- cgit v1.2.3