Home | History | Annotate | Download | only in util
      1 /*
      2  * Copyright (C) 2015 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.messaging.util;
     18 
     19 
     20 /**
     21  * Fake implementation which just returns the default values and ignores put operations.
     22  */
     23 public class FakeBuglePrefs extends BuglePrefs {
     24     public FakeBuglePrefs() {
     25     }
     26 
     27     @Override
     28     public int getInt(final String key, final int defaultValue) {
     29         return defaultValue;
     30     }
     31 
     32     @Override
     33     public long getLong(final String key, final long defaultValue) {
     34         return defaultValue;
     35     }
     36 
     37     @Override
     38     public boolean getBoolean(final String key, final boolean defaultValue) {
     39         return defaultValue;
     40     }
     41 
     42     @Override
     43     public String getString(final String key, final String defaultValue) {
     44         return defaultValue;
     45     }
     46 
     47     @Override
     48     public byte[] getBytes(String key) {
     49         return null;
     50     }
     51 
     52     @Override
     53     public void putInt(final String key, final int value) {
     54     }
     55 
     56     @Override
     57     public void putLong(final String key, final long value) {
     58     }
     59 
     60     @Override
     61     public void putBoolean(final String key, final boolean value) {
     62     }
     63 
     64     @Override
     65     public void putString(final String key, final String value) {
     66     }
     67 
     68     @Override
     69     public void putBytes(String key, byte[] value) {
     70     }
     71 
     72     @Override
     73     public String getSharedPreferencesName() {
     74         return "FakeBuglePrefs";
     75     }
     76 
     77     @Override
     78     public void onUpgrade(int oldVersion, int newVersion) {
     79     }
     80 
     81     @Override
     82     public void remove(String key) {
     83     }
     84 }
     85