* HomeActivity is enabled by default
* Certain activities and receivers are not exposed
-->
-<manifest android:versionCode="202"
- android:versionName="6.1"
+<manifest android:versionCode="203"
+ android:versionName="6.1.1"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.farmerbb.taskbar">
</intent-filter>
</receiver>
+ <provider
+ android:name=".provider.Kustom5SecsProvider"
+ android:authorities="${applicationId}.kustom5secsprovider"
+ android:grantUriPermissions="true"
+ android:exported="true"
+ android:enabled="true"/>
+
</application>
</manifest>
import android.widget.ImageView;
import android.widget.TextView;
+import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SwitchCompat;
AlertDialog dialog = builder.create();
dialog.show();
}
+
+ @Override
+ protected void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
+ // MainActivity manually handles its own state restoration
+ }
}
: params.updateWidth(WindowManager.LayoutParams.WRAP_CONTENT);
}
- host.updateViewLayout(layout, newParams);
+ try {
+ host.updateViewLayout(layout, newParams);
+ } catch (IllegalArgumentException ignored) {}
};
startRefreshingRecents();
package com.farmerbb.taskbar.util;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
}
}
+ @SuppressLint("UseCompatLoadingForDrawables")
private Bitmap loadBitmap(Context context, String drawableName) {
int id = getResources(context).getIdentifier(drawableName, "drawable", packageName);
if(id > 0) {
- Drawable bitmap = ContextCompat.getDrawable(context, id);
+ Drawable bitmap = getResources(context).getDrawable(id);
if(bitmap instanceof BitmapDrawable)
return ((BitmapDrawable) bitmap).getBitmap();
}
return null;
}
+ @SuppressLint("UseCompatLoadingForDrawables")
private Drawable loadDrawable(Context context, String drawableName) {
int id = getResources(context).getIdentifier(drawableName, "drawable", packageName);
if(id > 0) {
- return ContextCompat.getDrawable(context, id);
+ return getResources(context).getDrawable(id);
}
return null;
}
--- /dev/null
+// From https://gist.github.com/frmz/669eeca0b20b943b7091b9078eb3247e
+
+package com.farmerbb.taskbar.provider;
+
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.database.Cursor;
+import android.net.Uri;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.farmerbb.taskbar.activity.DummyActivity;
+
+public class Kustom5SecsProvider extends ContentProvider {
+
+ /**
+ * Path used by Kustom to ask a 5 secs delay reset
+ */
+ private final static String PATH_RESET_5SEC_DELAY = "reset5secs";
+
+ @Override
+ public boolean onCreate() {
+ return true;
+ }
+
+ @Nullable
+ @Override
+ public Cursor query(@NonNull Uri uri,
+ String[] projection,
+ String selection,
+ String[] selectionArgs,
+ String sortOrder) {
+ throw new UnsupportedOperationException("Unsupported");
+ }
+
+ @Nullable
+ @Override
+ public String getType(@NonNull Uri uri) {
+ // Not supported
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public Uri insert(@NonNull Uri uri, ContentValues values) {
+ // Not supported
+ throw new UnsupportedOperationException("Unsupported");
+ }
+
+ @Override
+ public int delete(@NonNull Uri uri,
+ String selection,
+ String[] selectionArgs) {
+ if(PATH_RESET_5SEC_DELAY.equals(uri.getLastPathSegment())) {
+ /**
+ * Lets ensure this gets executed only by Kustom
+ */
+ checkCallingPackage();
+ /**
+ * This assumes you have a transparent activity that will just call finish() during its onCreate method
+ * Activity in this case also provides a static method for starting itself
+ */
+ Intent intent = new Intent(getContext(), DummyActivity.class);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ getContext().startActivity(intent);
+ return 1;
+ }
+ return 0;
+ }
+
+ @Override
+ public int update(@NonNull Uri uri,
+ ContentValues values,
+ String selection,
+ String[] selectionArgs) {
+ // Not supported
+ throw new UnsupportedOperationException("Unsupported");
+ }
+
+ /**
+ * Will check weather or not calling pkg is authorized to talk with this provider
+ *
+ * @throws SecurityException
+ */
+ private void checkCallingPackage() throws SecurityException {
+ String callingPkg = getCallingPackage();
+ if ("org.kustom.wallpaper".equals(callingPkg)) return;
+ if ("org.kustom.widget".equals(callingPkg)) return;
+ if ("org.kustom.lockscreen".equals(callingPkg)) return;
+ throw new SecurityException("Unauthorized");
+ }
+}
\ No newline at end of file
</receiver>
<provider
+ android:name=".provider.Kustom5SecsProvider"
+ android:authorities="${applicationId}.kustom5secsprovider"
+ android:grantUriPermissions="true"
+ android:exported="true"
+ android:enabled="true"/>
+ <provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
ext {
// TODO keep version name and version code in sync with Android-x86 manifest
- VERSION_CODE = 202
- VERSION_NAME = "6.1"
+ VERSION_CODE = 203
+ VERSION_NAME = "6.1.1"
MIN_SDK_VERSION = 21
COMPILE_SDK_VERSION = 30
}
dependencies {
- implementation 'com.farmerbb:libtaskbar:2.1.0' // see badge above for latest version
+ implementation 'com.farmerbb:libtaskbar:2.1.1' // see badge above for latest version
}
```
### Changelog
-**v2.1.0**
-* Includes all changes from Taskbar 6.1
-* Prompts for enabling system alert window and usage access permissions now use the actual name of the app
+**v2.1.1**
+* Includes all changes from Taskbar 6.1.1
_Known issues:_
* libtaskbar currently does not support launchers with a targetSdkVersion of 30 or higher
+**v2.1.0**
+* Includes all changes from Taskbar 6.1
+* Prompts for enabling system alert window and usage access permissions now use the actual name of the app
+
**v2.0.0**
* Includes all changes from Taskbar 6.0
* libtaskbar components now run in a separate process from the rest of the app