Skip to content

Commit

Permalink
Don't allow the safeguard to reset resolution if Taskbar's desktop mo…
Browse files Browse the repository at this point in the history
…de is active
  • Loading branch information
farmerbb committed Nov 16, 2020
1 parent 99c4c42 commit 5e994ba
Showing 1 changed file with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ShortcutInfo;
Expand Down Expand Up @@ -142,12 +143,21 @@ protected Void doInBackground(Void... params) {
su[chromeCommand] = U.chromeCommandRemove;
su[sizeCommand] = U.sizeCommand(MainActivity.this, "reset");

if(!(getPackageManager().hasSystemFeature("com.cyanogenmod.android")
PackageManager pm = getPackageManager();
if(!(pm.hasSystemFeature("com.cyanogenmod.android")
&& Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1)) {
su[densityCommand] = U.densityCommand(MainActivity.this, "reset");
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
ActivityInfo info = pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY).activityInfo;

if(!info.packageName.startsWith("com.farmerbb.taskbar")
|| !info.name.endsWith("HSLActivity")
|| !U.isDesktopModeActive(MainActivity.this)) {
su[densityCommand] = U.densityCommand(MainActivity.this, "reset");

// We run the density command twice, for reliability
su[densityCommand2] = su[densityCommand];
// We run the density command twice, for reliability
su[densityCommand2] = su[densityCommand];
}
}

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
Expand Down

0 comments on commit 5e994ba

Please sign in to comment.