That fuck shit the fascists are using
at master 53 lines 1.8 kB view raw
1/** 2 * Copyright (C) 2019 Open Whisper Systems 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18package org.tm.archive.migrations; 19 20import android.os.Bundle; 21 22import org.signal.core.util.logging.Log; 23import org.tm.archive.BaseActivity; 24import org.tm.archive.R; 25 26/** 27 * An activity that can be shown to block access to the rest of the app when a long-running or 28 * otherwise blocking application-level migration is happening. 29 */ 30public class ApplicationMigrationActivity extends BaseActivity { 31 32 private static final String TAG = Log.tag(ApplicationMigrationActivity.class); 33 34 @Override 35 public void onCreate(Bundle bundle) { 36 super.onCreate(bundle); 37 38 ApplicationMigrations.getUiBlockingMigrationStatus().observe(this, running -> { 39 if (running == null) { 40 return; 41 } 42 43 if (running) { 44 Log.i(TAG, "UI-blocking migration is in progress. Showing spinner."); 45 setContentView(R.layout.application_migration_activity); 46 } else { 47 Log.i(TAG, "UI-blocking migration is no-longer in progress. Finishing."); 48 startActivity(getIntent().getParcelableExtra("next_intent")); 49 finish(); 50 } 51 }); 52 } 53}