67 lines
2.4 KiB
Java
67 lines
2.4 KiB
Java
package io.fabric.sdk.android;
|
|
|
|
import android.annotation.TargetApi;
|
|
import android.content.Context;
|
|
import android.content.ContextWrapper;
|
|
import android.content.SharedPreferences;
|
|
import android.database.DatabaseErrorHandler;
|
|
import android.database.sqlite.SQLiteDatabase;
|
|
import java.io.File;
|
|
|
|
/* loaded from: classes2.dex */
|
|
class FabricContext extends ContextWrapper {
|
|
private final String a;
|
|
private final String b;
|
|
|
|
public FabricContext(Context context, String str, String str2) {
|
|
super(context);
|
|
this.b = str;
|
|
this.a = str2;
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
public File getCacheDir() {
|
|
return new File(super.getCacheDir(), this.a);
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
public File getDatabasePath(String str) {
|
|
File file = new File(super.getDatabasePath(str).getParentFile(), this.a);
|
|
file.mkdirs();
|
|
return new File(file, str);
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
@TargetApi(8)
|
|
public File getExternalCacheDir() {
|
|
return new File(super.getExternalCacheDir(), this.a);
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
@TargetApi(8)
|
|
public File getExternalFilesDir(String str) {
|
|
return new File(super.getExternalFilesDir(str), this.a);
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
public File getFilesDir() {
|
|
return new File(super.getFilesDir(), this.a);
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
public SharedPreferences getSharedPreferences(String str, int i) {
|
|
return super.getSharedPreferences(this.b + ":" + str, i);
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
public SQLiteDatabase openOrCreateDatabase(String str, int i, SQLiteDatabase.CursorFactory cursorFactory) {
|
|
return SQLiteDatabase.openOrCreateDatabase(getDatabasePath(str), cursorFactory);
|
|
}
|
|
|
|
@Override // android.content.ContextWrapper, android.content.Context
|
|
@TargetApi(11)
|
|
public SQLiteDatabase openOrCreateDatabase(String str, int i, SQLiteDatabase.CursorFactory cursorFactory, DatabaseErrorHandler databaseErrorHandler) {
|
|
return SQLiteDatabase.openOrCreateDatabase(getDatabasePath(str).getPath(), cursorFactory, databaseErrorHandler);
|
|
}
|
|
}
|