Cleanup InvisibleActivityFreeform
@@ -76,7 +76,10 @@ public class InvisibleActivityFreeform extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- if(FreeformHackHelper.getInstance().isFreeformHackActive()) {
+ FreeformHackHelper helper = FreeformHackHelper.getInstance();
+ SharedPreferences pref = U.getSharedPreferences(this);
+
+ if(helper.isFreeformHackActive()) {
proceedWithOnCreate = false;
super.finish();
}
@@ -91,7 +94,6 @@ public class InvisibleActivityFreeform extends Activity {
}
if(U.isChromeOs(this)) {
- FreeformHackHelper helper = FreeformHackHelper.getInstance();
helper.setFreeformHackActive(true);
helper.setInFreeformWorkspace(true);
@@ -118,13 +120,11 @@ public class InvisibleActivityFreeform extends Activity {
LocalBroadcastManager.getInstance(this).registerReceiver(disappearingReceiver, disappearingReceiverFilter);
LocalBroadcastManager.getInstance(this).registerReceiver(finishReceiver, new IntentFilter("com.farmerbb.taskbar.FINISH_FREEFORM_ACTIVITY"));
- FreeformHackHelper helper = FreeformHackHelper.getInstance();
helper.setFreeformHackActive(true);
// Show power button warning on CyanogenMod / LineageOS devices
- if(getPackageManager().hasSystemFeature("com.cyanogenmod.android")) {
- SharedPreferences pref = U.getSharedPreferences(this);
- if(!pref.getString("power_button_warning", "null").equals(Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID))) {
+ if(getPackageManager().hasSystemFeature("com.cyanogenmod.android")
+ && !pref.getString("power_button_warning", "null").equals(Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID))) {
new Handler().postDelayed(() -> {
if(helper.isInFreeformWorkspace()) {
Intent intent = null;
@@ -147,7 +147,6 @@ public class InvisibleActivityFreeform extends Activity {
}
}, 100);
}
- }
showTaskbar = true;
}
