use of info.guardianproject.cacheword.CacheWordHandler in project storymaker by StoryMaker.
the class LockablePreferenceActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", BaseActivity.CACHEWORD_TIMEOUT));
mCacheWordHandler = new CacheWordHandler(this, timeout);
}
use of info.guardianproject.cacheword.CacheWordHandler in project storymaker by StoryMaker.
the class SMPanicResponderActivity method onCreate.
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// need to check for pin before locking
SharedPreferences sp = getSharedPreferences("appPrefs", MODE_PRIVATE);
String cachewordStatus = sp.getString("cacheword_status", "default");
if (cachewordStatus.equals(BaseActivity.CACHEWORD_SET)) {
//Timber.d("panic - pin set, panic!");
Intent intent = getIntent();
if (intent != null && PANIC_TRIGGER_ACTION.equals(intent.getAction())) {
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", BaseActivity.CACHEWORD_TIMEOUT));
CacheWordHandler cacheWordHandler = new CacheWordHandler(this, timeout);
cacheWordHandler.connectToService();
cacheWordHandler.lock();
cacheWordHandler.disconnectFromService();
ExitActivity.exitAndRemoveFromRecentApps(this);
}
} else {
//Timber.d("panic - no pin set, don't panic!");
}
if (Build.VERSION.SDK_INT >= 21) {
finishAndRemoveTask();
} else {
finish();
}
}
use of info.guardianproject.cacheword.CacheWordHandler in project storymaker by StoryMaker.
the class BaseActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", CACHEWORD_TIMEOUT));
mCacheWordHandler = new CacheWordHandler(this, timeout);
if (!Eula.isAccepted(this)) {
Intent firstStartIntent = new Intent(this, FirstStartActivity.class);
firstStartIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(firstStartIntent);
}
setContentView(R.layout.activity_base);
getActionBar().setHomeButtonEnabled(true);
}
use of info.guardianproject.cacheword.CacheWordHandler in project storymaker by StoryMaker.
the class SceneEditorActivity method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.exportProjectFiles:
exportProjectFiles();
return true;
case R.id.itemInfo:
Intent intent = new Intent(this, StoryInfoActivity.class);
intent.putExtra("pid", mProject.getId());
startActivity(intent);
return true;
case R.id.purgePublishTables:
// NEW/CACHEWORD
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", CACHEWORD_TIMEOUT));
mCacheWordHandler = new CacheWordHandler(getBaseContext(), this, timeout);
mCacheWordHandler.connectToService();
SQLiteDatabase db = new StoryMakerDB(mCacheWordHandler, getBaseContext()).getWritableDatabase();
JobTable foo;
(new PublishJobTable(db)).debugPurgeTable();
(new JobTable(db)).debugPurgeTable();
db.close();
return true;
}
return super.onOptionsItemSelected(item);
}
use of info.guardianproject.cacheword.CacheWordHandler in project storymaker by StoryMaker.
the class CacheWordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lock_screen);
Intent intent = getIntent();
setPin = intent.getBooleanExtra(BaseActivity.CACHEWORD_FIRST_LOCK, false);
if (setPin) {
Timber.d("got flag for cacheword pin initialization");
} else {
Timber.d("no flag for cacheword pin initialization");
}
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
int timeout = Integer.parseInt(settings.getString("pcachewordtimeout", BaseActivity.CACHEWORD_TIMEOUT));
mCacheWordHandler = new CacheWordHandler(this, timeout);
mViewEnterPin = findViewById(R.id.llEnterPin);
mViewCreatePin = findViewById(R.id.llCreatePin);
mTextEnterPin = (EditText) findViewById(R.id.editEnterPin);
mTextCreatePin = (EditText) findViewById(R.id.editCreatePin);
mTextConfirmPin = (EditText) findViewById(R.id.editConfirmPin);
ViewFlipper vf = (ViewFlipper) findViewById(R.id.viewFlipper);
LinearLayout flipView1 = (LinearLayout) findViewById(R.id.flipView1);
LinearLayout flipView2 = (LinearLayout) findViewById(R.id.flipView2);
mSlider = new TwoViewSlider(vf, flipView1, flipView2, mTextCreatePin, mTextConfirmPin);
}
Aggregations