@@ -92,27 +92,10 @@ public class MainService extends @@watchface_classs@@ {
92
92
final Intent permIntent = new Intent(this, PermissionRequestActivity.class);
93
93
permIntent.putExtra(KEY_RESULT_RECEIVER, resultReceiver);
94
94
permIntent.putExtra(KEY_PERMISSIONS, permissions);
95
- permIntent.putExtra(KEY_REQUEST_CODE, requestCode);
95
+ permIntent.putExtra(KEY_REQUEST_CODE, requestCode);
96
+ // Show the dialog requesting the permissions
96
97
permIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
97
98
startActivity(permIntent);
98
-
99
- // Create a notification on watch faces, otherwise it does not work.
100
- /*
101
- TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
102
- stackBuilder.addNextIntent(permIntent);
103
- PendingIntent permPendingIntent = stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);
104
- NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
105
- .setSmallIcon(R.drawable.icon)
106
- .setContentTitle("Requesting permissions")
107
- .setContentText("The watch face need permissions to work properly")
108
- .setOngoing(true)
109
- .setAutoCancel(true)
110
- .setWhen(0)
111
- .setContentIntent(permPendingIntent)
112
- .setStyle(null);
113
- NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
114
- notificationManager.notify(requestCode, builder.build());
115
- */
116
99
}
117
100
118
101
public static class PermissionRequestActivity extends Activity {
0 commit comments