summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/util
diff options
context:
space:
mode:
authorlinyuh <linyuh@google.com>2017-12-27 17:02:37 -0800
committerCopybara-Service <copybara-piper@google.com>2017-12-27 17:03:47 -0800
commit183cb71663320f16149d83eeebaff7795a4b55f2 (patch)
treebc8bfcce809257b3ddbb423a9808082292b9f6a3 /java/com/android/dialer/util
parentfc81a030a7b4f6d4a497f71aed593d398795e7da (diff)
Remove field prefixes.
Test: Existing tests PiperOrigin-RevId: 180230450 Change-Id: I0b2589cfeeaef81e42a04efa48af24b4e4d0e95f
Diffstat (limited to 'java/com/android/dialer/util')
-rw-r--r--java/com/android/dialer/util/ExpirableCache.java32
-rw-r--r--java/com/android/dialer/util/TouchPointManager.java12
-rw-r--r--java/com/android/dialer/util/TransactionSafeActivity.java12
3 files changed, 28 insertions, 28 deletions
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<K, V> {
*
* @see ExpirableCache.CachedValue#isExpired()
*/
- private final AtomicInteger mGeneration;
+ private final AtomicInteger generation;
/** The underlying cache used to stored the cached values. */
- private LruCache<K, CachedValue<V>> mCache;
+ private LruCache<K, CachedValue<V>> cache;
private ExpirableCache(LruCache<K, CachedValue<V>> cache) {
- mCache = cache;
- mGeneration = new AtomicInteger(0);
+ this.cache = cache;
+ generation = new AtomicInteger(0);
}
/**
@@ -147,7 +147,7 @@ public class ExpirableCache<K, V> {
* @param key the key to look up
*/
public CachedValue<V> getCachedValue(K key) {
- return mCache.get(key);
+ return cache.get(key);
}
/**
@@ -190,7 +190,7 @@ public class ExpirableCache<K, V> {
* @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<K, V> {
* <p>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<K, V> {
* <p>Implementation of {@link LruCache#create(K)} can use this method to create a new entry.
*/
public CachedValue<V> newCachedValue(V value) {
- return new GenerationalCachedValue<V>(value, mGeneration);
+ return new GenerationalCachedValue<V>(value, generation);
}
/**
@@ -239,31 +239,31 @@ public class ExpirableCache<K, V> {
private static class GenerationalCachedValue<V> implements ExpirableCache.CachedValue<V> {
/** 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;
}
}