Skip to content

Commit

Permalink
fix: Update application ID to circumvent blacklisting
Browse files Browse the repository at this point in the history
  • Loading branch information
ns130291 committed Jun 22, 2023
1 parent 809cf79 commit dc1f605
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
Show widgets in Android Auto

Support thread on [XDA](https://forum.xda-developers.com/android-auto/android-auto-general/app-widgets-android-auto-t3744179)

## Installation

Use https://github.com/fcaronte/KingInstaller to install latest version from the [release page](https://github.com/ns130291/widgets-for-auto/releases) (use >= v0.2.3 as the older application ID is blacklisted by Google in Android Auto)
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 33
defaultConfig {
applicationId "de.nsvb.android.auto.widget"
applicationId "de.nsvb.android.auto.w4a"
minSdkVersion 21
targetSdkVersion 33
versionCode 4
versionName "0.2.2"
versionCode 5
versionName "0.2.3"
}

ext {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,24 @@ public void createWidget(Intent data) {
*/
public void createWidget(int appWidgetId) {
AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.getAppWidgetInfo(appWidgetId);
if (appWidgetInfo != null) {
AppWidgetHostView hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
hostView.setAppWidget(appWidgetId, appWidgetInfo);

AppWidgetHostView hostView = mAppWidgetHost.createView(this, appWidgetId, appWidgetInfo);
hostView.setAppWidget(appWidgetId, appWidgetInfo);
mWidgetContainer.addView(hostView);

mWidgetContainer.addView(hostView);
mButtonAddWidget.setText("Remove Widget");

mButtonAddWidget.setText("Remove Widget");

requestedAppWidgetID = -1;
Log.i(TAG, "The widget size is: " + appWidgetInfo.minWidth + "*" + appWidgetInfo.minHeight);
requestedAppWidgetID = -1;
Log.i(TAG, "The widget size is: " + appWidgetInfo.minWidth + "*" + appWidgetInfo.minHeight);
} else {
Log.e(TAG, "Failed to create widget view for widgetId " + appWidgetId);
mAppWidgetHost.deleteAppWidgetId(appWidgetId);
if (widgetID == appWidgetId) {
widgetID = -1;
getSharedPreferences(PREFS_NAME, MODE_PRIVATE).edit().putInt(WIDGET_ID, widgetID).commit();
}
}
}

public void removeWidget() {
Expand Down

0 comments on commit dc1f605

Please sign in to comment.