@Test public void testDeleteAccountClearsSharedPrefsAndDeletesFiles() throws Exception { File libDir = new File(testDir, "lib"); File libFile = new File(libDir, "file"); File sharedPrefsDir = new File(testDir, "shared_prefs"); File sharedPrefsFile = new File(sharedPrefsDir, "file"); File cacheDir = new File(testDir, "cache"); File cacheFile = new File(cacheDir, "file"); File potatoDir = new File(testDir, ".potato"); File potatoFile = new File(potatoDir, "file"); context.checking(new Expectations() {{ oneOf(prefs).edit(); will(returnValue(editor)); oneOf(editor).clear(); will(returnValue(editor)); oneOf(editor).commit(); will(returnValue(true)); oneOf(defaultPrefs).edit(); will(returnValue(editor)); oneOf(editor).clear(); will(returnValue(editor)); oneOf(editor).commit(); will(returnValue(true)); oneOf(app).getApplicationInfo(); will(returnValue(applicationInfo)); }}); assertTrue(dbDir.mkdirs()); assertTrue(keyDir.mkdirs()); assertTrue(libDir.mkdirs()); assertTrue(libFile.createNewFile()); assertTrue(sharedPrefsDir.mkdirs()); assertTrue(sharedPrefsFile.createNewFile()); assertTrue(cacheDir.mkdirs()); assertTrue(cacheFile.createNewFile()); assertTrue(potatoDir.mkdirs()); assertTrue(potatoFile.createNewFile()); accountManager.deleteAccount(); assertFalse(dbDir.exists()); assertFalse(keyDir.exists()); assertTrue(libDir.exists()); assertTrue(libFile.exists()); assertTrue(sharedPrefsDir.exists()); assertTrue(sharedPrefsFile.exists()); assertTrue(cacheDir.exists()); assertFalse(cacheFile.exists()); assertFalse(potatoDir.exists()); assertFalse(potatoFile.exists()); }
@Override public void deleteAccount() { synchronized (stateChangeLock) { super.deleteAccount(); SharedPreferences defaultPrefs = getDefaultSharedPreferences(); deleteAppData(prefs, defaultPrefs); } }
AndroidAccountManager extends AccountManagerImpl implements AccountManager { @Override public void deleteAccount() { synchronized (stateChangeLock) { super.deleteAccount(); SharedPreferences defaultPrefs = getDefaultSharedPreferences(); deleteAppData(prefs, defaultPrefs); } } }
AndroidAccountManager extends AccountManagerImpl implements AccountManager { @Override public void deleteAccount() { synchronized (stateChangeLock) { super.deleteAccount(); SharedPreferences defaultPrefs = getDefaultSharedPreferences(); deleteAppData(prefs, defaultPrefs); } } @Inject  AndroidAccountManager(DatabaseConfig databaseConfig,
			CryptoComponent crypto, IdentityManager identityManager,
			SharedPreferences prefs, Application app); }
AndroidAccountManager extends AccountManagerImpl implements AccountManager { @Override public void deleteAccount() { synchronized (stateChangeLock) { super.deleteAccount(); SharedPreferences defaultPrefs = getDefaultSharedPreferences(); deleteAppData(prefs, defaultPrefs); } } @Inject  AndroidAccountManager(DatabaseConfig databaseConfig,
			CryptoComponent crypto, IdentityManager identityManager,
			SharedPreferences prefs, Application app); @Override void deleteAccount(); }
AndroidAccountManager extends AccountManagerImpl implements AccountManager { @Override public void deleteAccount() { synchronized (stateChangeLock) { super.deleteAccount(); SharedPreferences defaultPrefs = getDefaultSharedPreferences(); deleteAppData(prefs, defaultPrefs); } } @Inject  AndroidAccountManager(DatabaseConfig databaseConfig,
			CryptoComponent crypto, IdentityManager identityManager,
			SharedPreferences prefs, Application app); @Override void deleteAccount();  }