Implement camera swap notification here

CameraSwapInfo now shows the notification for swapped cameras itself.
Further, the webview is removed in favor of the offline details
activity with a link.

Protect the notification service with a custom (platform signature)
permission.

FPIIM-1578

Change-Id: Ie996ebda6bb0bb9eaf03c5e201f1a6a22a374cee
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 1aebbf1..4af2011 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -4,7 +4,11 @@
     android:versionCode="1"
     android:versionName="1.0.0">
 
-    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+
+    <permission
+        android:name="com.fairphone.cameraswapinfo.permission.HANDLE_CAMERA_CHANGED"
+        android:protectionLevel="signature"/>
 
     <application
         android:allowBackup="true"
@@ -13,6 +17,15 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme">
 
+        <receiver
+            android:name=".BootUpReceiver"
+            android:enabled="false"
+            android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
+            <intent-filter>
+                <action android:name="android.intent.action.BOOT_COMPLETED" />
+            </intent-filter>
+        </receiver>
+
         <activity android:name=".CameraSwapDetailsActivity"
             android:enabled="true"
             android:theme="@style/Theme.Setup">
@@ -21,6 +34,13 @@
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity>
+
+        <service
+            android:name=".CameraSwapNotificationService"
+            android:enabled="true"
+            android:exported="true"
+            android:permission="com.fairphone.psensor.permission.HANDLE_CAMERA_CHANGED" />
+
     </application>
 
 </manifest>
diff --git a/app/src/main/java/com/fairphone/cameraswapinfo/BootUpReceiver.java b/app/src/main/java/com/fairphone/cameraswapinfo/BootUpReceiver.java
new file mode 100644
index 0000000..821156b
--- /dev/null
+++ b/app/src/main/java/com/fairphone/cameraswapinfo/BootUpReceiver.java
@@ -0,0 +1,32 @@
+package com.fairphone.cameraswapinfo;
+
+import android.content.BroadcastReceiver;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+
+public class BootUpReceiver extends BroadcastReceiver {
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
+            if (CameraSwapInfoPreferences.doesNotificationNeedDismissal(context)) {
+                CameraSwapNotificationUtil.showNotification(context);
+            }
+        }
+    }
+
+    public static void disable(Context context) {
+        PackageManager pm = context.getPackageManager();
+        ComponentName componentName = new ComponentName(context, BootUpReceiver.class);
+        pm.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
+                PackageManager.DONT_KILL_APP);
+    }
+
+    public static void enable(Context context) {
+        PackageManager pm = context.getPackageManager();
+        ComponentName componentName = new ComponentName(context, BootUpReceiver.class);
+        pm.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
+                PackageManager.DONT_KILL_APP);
+    }
+}
diff --git a/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapDetailsActivity.java b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapDetailsActivity.java
index 5d61236..cb1e1fd 100644
--- a/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapDetailsActivity.java
+++ b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapDetailsActivity.java
@@ -1,16 +1,11 @@
 package com.fairphone.cameraswapinfo;
 
 import android.app.Activity;
-import android.content.Intent;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.WebResourceError;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
 import android.widget.Button;
-import android.widget.CompoundButton;
+import android.widget.TextView;
 
 /**
  * Display information and instructions what to do after a camera replacement.
@@ -18,89 +13,54 @@
  * Defaults to loading a support article in a WebView. Shows limited information in case of
  * lacking internet connection.
  */
-public class CameraSwapDetailsActivity extends Activity implements View.OnClickListener,
-        CompoundButton.OnCheckedChangeListener {
+public class CameraSwapDetailsActivity extends Activity implements View.OnClickListener {
 
-    private static final String MODULE_DETECT_PACKAGE = "com.fairphone.moduledetect";
-    private static final String CAMERA_SWAP_INTENT_SERVICE_CLASS =
-            "com.fairphone.moduledetect.CameraSwapIntentService";
-    private static final String NOTIFICATION_DISMISS_ACTION =
-            "com.fairphone.moduledetect.notification_dismiss";
+    private final String TAG ="CameraSwapInfo";
 
-    Button mButtonClose;
-    CompoundButton mDontShowAgainCheckbox;
-    boolean mDontShowAgain = false;
+    Button mButtonGotIt;
+    Button mButtonRemindLater;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        /* Try loading an online support article by default. */
+        destroyNotification();
         setContentView(R.layout.camera_swap_details_activity);
-        WebView webview = (WebView) findViewById(R.id.camera_swap_webview);
-
-        webview.setWebViewClient(new WebViewClient() {
-            private boolean shouldDismissNotification = true;
-
-            @Override
-            public void onPageFinished(WebView view, String url) {
-                super.onPageFinished(view, url);
-
-                if (shouldDismissNotification) {
-                    /* We do not want to bother users again if they have seen the information.
-                       Do not show notification again if support article has successfully loaded. */
-                    dismissNotification();
-                }
-            }
-
-            @Override
-            public void onReceivedError(WebView view, WebResourceRequest request,
-                                        WebResourceError error) {
-                shouldDismissNotification = false;
-                /* Show a limited offline view in case of connectivity problems. */
-                replaceWithOfflineContent();
-            }
-        });
-
-        webview.loadUrl(getString(R.string.camera_swap_url));
+        setInstructionsText();
+        configureButtons();
     }
 
     @Override
     public void onClick(View view) {
-        if (view == mButtonClose) {
-            if (mDontShowAgain) {
-                dismissNotification();
-            }
-            finish();
+        if (view == mButtonGotIt) {
+            CameraSwapInfoPreferences.setNotificationNeedsDismissal(this, false);
+            BootUpReceiver.disable(this);
+        } else if (view == mButtonRemindLater){
+            Log.i(TAG, "Closing CameraSwapInfo details activity. Will remind the user on next boot.");
+        }
+        finish();
+    }
+
+    private void configureButtons() {
+        mButtonGotIt = (Button) findViewById(R.id.button_got_it);
+        mButtonGotIt.setOnClickListener(CameraSwapDetailsActivity.this);
+        mButtonRemindLater = (Button) findViewById(R.id.button_remind_later);
+        mButtonRemindLater.setOnClickListener(CameraSwapDetailsActivity.this);
+    }
+
+    private void setInstructionsText() {
+        TextView textView = (TextView) findViewById(R.id.part1);
+
+        if (!CameraSwapInfoPreferences.hasFrontCameraChanged(this)) {
+            textView.setText(getString(R.string.camera_swap_text_part1_main));
+        } else if (!CameraSwapInfoPreferences.hasMainCameraChanged(this)) {
+            textView.setText(getString(R.string.camera_swap_text_part1_front));
+        } else {
+            textView.setText(getString(R.string.camera_swap_text_part1_both));
         }
     }
 
-    @Override
-    public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
-        if (compoundButton == mDontShowAgainCheckbox) {
-            mDontShowAgain = b;
-        }
-    }
-
-    private void replaceWithOfflineContent() {
-        View view = findViewById(R.id.camera_swap_webview_fragment);
-        ViewGroup parent = (ViewGroup) view.getParent();
-        int index = parent.indexOfChild(view);
-        parent.removeView(view);
-
-        View replacement = getLayoutInflater().inflate(R.layout.offline_details_fragment,
-                parent, false);
-        parent.addView(replacement, index);
-
-        mButtonClose = (Button) findViewById(R.id.button_close);
-        mButtonClose.setOnClickListener(CameraSwapDetailsActivity.this);
-        mDontShowAgainCheckbox = (CompoundButton) findViewById(R.id.dont_show_again_checkbox);
-        mDontShowAgainCheckbox.setOnCheckedChangeListener(CameraSwapDetailsActivity.this);
-    }
-
-    private void dismissNotification() {
-        Intent dismissIntent = new Intent(NOTIFICATION_DISMISS_ACTION);
-        dismissIntent.setClassName(MODULE_DETECT_PACKAGE, CAMERA_SWAP_INTENT_SERVICE_CLASS);
-        startService(dismissIntent);
+    private void destroyNotification() {
+        CameraSwapNotificationUtil.destroyNotification(this);
     }
 }
diff --git a/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapInfoPreferences.java b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapInfoPreferences.java
new file mode 100644
index 0000000..6cedafd
--- /dev/null
+++ b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapInfoPreferences.java
@@ -0,0 +1,54 @@
+package com.fairphone.cameraswapinfo;
+
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
+
+public class CameraSwapInfoPreferences {
+    private static final String PREF_HAS_FRONT_CAMERA_CHANGED =
+            "com.fairphone.cameraswapinfo.pref_has_front_camera_changed";
+    private static final String PREF_HAS_MAIN_CAMERA_CHANGED =
+            "com.fairphone.cameraswapinfo.pref_has_main_camera_changed";
+    private static final String PREF_NOTIFICATION_IS_DISMISSED =
+            "com.fairphone.moduledetect.notification_needs_dismissal";
+
+
+    static void setFrontCameraChanged(Context context, boolean hasChanged) {
+        SharedPreferences preferenceManager =
+                PreferenceManager.getDefaultSharedPreferences(context);
+        preferenceManager.edit().putBoolean(PREF_HAS_FRONT_CAMERA_CHANGED, hasChanged).apply();
+    }
+
+    static boolean hasFrontCameraChanged(Context context) {
+        SharedPreferences preferenceManager =
+                PreferenceManager.getDefaultSharedPreferences(context);
+        return preferenceManager.getBoolean(PREF_HAS_FRONT_CAMERA_CHANGED, false);
+    }
+
+    static void setMainCameraChanged(Context context, boolean hasChanged) {
+        SharedPreferences preferenceManager =
+                PreferenceManager.getDefaultSharedPreferences(context);
+        preferenceManager.edit().putBoolean(PREF_HAS_MAIN_CAMERA_CHANGED, hasChanged).apply();
+    }
+
+    static boolean hasMainCameraChanged(Context context) {
+        SharedPreferences preferenceManager =
+                PreferenceManager.getDefaultSharedPreferences(context);
+        return preferenceManager.getBoolean(PREF_HAS_MAIN_CAMERA_CHANGED, false);
+    }
+
+
+    static boolean doesNotificationNeedDismissal(Context context) {
+        SharedPreferences preferenceManager =
+                PreferenceManager.getDefaultSharedPreferences(context);
+        return preferenceManager.getBoolean(PREF_NOTIFICATION_IS_DISMISSED, false);
+    }
+
+
+    static void setNotificationNeedsDismissal(Context context, boolean needsDismissal) {
+        SharedPreferences preferenceManager =
+                PreferenceManager.getDefaultSharedPreferences(context);
+        preferenceManager.edit().putBoolean(PREF_NOTIFICATION_IS_DISMISSED, needsDismissal).apply();
+    }
+}
diff --git a/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapNotificationService.java b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapNotificationService.java
new file mode 100644
index 0000000..aff2fb7
--- /dev/null
+++ b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapNotificationService.java
@@ -0,0 +1,46 @@
+package com.fairphone.cameraswapinfo;
+
+import android.app.IntentService;
+import android.content.Intent;
+import android.util.Log;
+
+public class CameraSwapNotificationService extends IntentService {
+
+    static final String ACTION_HANDLE_CAMERA_CHANGED =
+                    "com.fairphone.cameraswapinfo.handle_camera_change";
+    static final String TAG = "CameraSwapInfo";
+
+
+    public CameraSwapNotificationService() {
+        super("CameraSwapNotificationService");
+    }
+
+    @Override
+    protected void onHandleIntent(Intent intent) {
+        if (intent != null) {
+            final String action = intent.getAction();
+            if (ACTION_HANDLE_CAMERA_CHANGED.equals(action)) {
+                handleCameraChanged(intent);
+            }
+        }
+    }
+
+    private void handleCameraChanged(Intent intent) {
+        boolean hasFrontCameraChanged = intent.getBooleanExtra("frontCameraChanged", false);
+        boolean hasMainCameraChanged = intent.getBooleanExtra("mainCameraChanged", false);
+
+        if (!hasFrontCameraChanged && !hasMainCameraChanged) {
+            Log.w(TAG, "handleCameraChanged: No camera changed. Doing Nothing.");
+            return;
+        }
+
+        /* persist the changed cameras */
+        CameraSwapInfoPreferences.setFrontCameraChanged(this, hasFrontCameraChanged);
+        CameraSwapInfoPreferences.setMainCameraChanged(this, hasMainCameraChanged);
+
+        /* we have to be able to remind user on next boot */
+        BootUpReceiver.enable(this);
+
+        CameraSwapNotificationUtil.showNotification(this);
+    }
+}
diff --git a/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapNotificationUtil.java b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapNotificationUtil.java
new file mode 100644
index 0000000..1c708ba
--- /dev/null
+++ b/app/src/main/java/com/fairphone/cameraswapinfo/CameraSwapNotificationUtil.java
@@ -0,0 +1,65 @@
+package com.fairphone.cameraswapinfo;
+
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.support.v4.app.NotificationCompat;
+
+public class CameraSwapNotificationUtil {
+    static final String PACKAGE_CAMERA_SWAP_INFO = "com.fairphone.cameraswapinfo";
+    static final String ACTIVITY_CAMERA_SWAP_INFO_DETAILS =
+            "com.fairphone.cameraswapinfo.CameraSwapDetailsActivity";
+    static final int NOTIFICATION_ID = 0;
+
+    static protected String getNotificationTitle(Context context) {
+        return context.getString(R.string.camera_swap_notification_title);
+    }
+
+    static protected String getNotificationShortSummary(Context context) {
+        return context.getString(R.string.camera_swap_notification_summary);
+    }
+
+    static protected String getNotificationExtendedSummary(Context context) {
+        return context.getString(R.string.camera_swap_notification_summary) + " "
+                + context.getString(R.string.camera_swap_notification_text);
+    }
+
+    public static void showNotification(Context context) {
+        Notification notification = getNotification(context);
+        CameraSwapInfoPreferences.setNotificationNeedsDismissal(context, true);
+        NotificationManager notificationManager = (NotificationManager) context
+                .getSystemService(Context.NOTIFICATION_SERVICE);
+        notificationManager.notify(NOTIFICATION_ID, notification);
+    }
+
+    public static void destroyNotification(Context context) {
+        NotificationManager notificationManager = (NotificationManager) context
+                .getSystemService(Context.NOTIFICATION_SERVICE);
+        notificationManager.cancel(NOTIFICATION_ID);
+    }
+
+    static private Notification getNotification(Context context) {
+        PendingIntent openIntent = getPendingIntent(context);
+        NotificationCompat.Builder mBuilder =
+                new NotificationCompat.Builder(context)
+                        .setSmallIcon(R.drawable.ic_stat_camera_swap)
+                        .setContentTitle(getNotificationTitle(context))
+                        .setContentText(getNotificationShortSummary(context))
+                        .setStyle(new NotificationCompat.BigTextStyle().bigText(
+                                getNotificationExtendedSummary(context)))
+                        .setColor(context.getResources().getColor(R.color.colorPrimary))
+                        .setPriority(Notification.PRIORITY_MAX)
+                        .setVisibility(Notification.VISIBILITY_PUBLIC)
+                        .setContentIntent(openIntent)
+                        .setOngoing(true);
+        return mBuilder.build();
+    }
+
+    private static PendingIntent getPendingIntent(Context context) {
+        Intent intent = new Intent(Intent.ACTION_MAIN);
+        intent.setClassName(PACKAGE_CAMERA_SWAP_INFO, ACTIVITY_CAMERA_SWAP_INFO_DETAILS);
+        return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+    }
+}
diff --git a/app/src/main/res/layout/camera_swap_details_activity.xml b/app/src/main/res/layout/camera_swap_details_activity.xml
index cf96fe7..5cbba3e 100644
--- a/app/src/main/res/layout/camera_swap_details_activity.xml
+++ b/app/src/main/res/layout/camera_swap_details_activity.xml
@@ -7,6 +7,6 @@
     tools:context="com.fairphone.cameraswapinfo.CameraSwapDetailsActivity"
     android:orientation="vertical">
 
-    <include layout="@layout/webview_fragment" />
+    <include layout="@layout/details_fragment" />
 
 </LinearLayout>
diff --git a/app/src/main/res/layout/details_fragment.xml b/app/src/main/res/layout/details_fragment.xml
new file mode 100644
index 0000000..5f9351d
--- /dev/null
+++ b/app/src/main/res/layout/details_fragment.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/offline_details_fragment"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <include layout="@layout/header_fragment" />
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/background"
+        android:padding="@dimen/main_padding">
+
+        <Button
+            android:id="@+id/button_got_it"
+            style="@style/ButtonWhiteBlue"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:text="@string/camera_swap_got_it" />
+
+        <TextView
+            android:id="@+id/part1"
+            style="@style/TextBold16BlueDark"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_alignParentTop="true"
+            android:layout_marginStart="5dp"
+            android:layout_marginEnd="5dp"
+            android:lineSpacingExtra="4sp"
+            android:text="@string/camera_swap_text_part1_both" />
+
+        <TextView
+            android:id="@+id/instructions"
+            style="@style/TextRegular14BlueDark"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="5dp"
+            android:layout_marginEnd="5dp"
+            android:layout_marginTop="@dimen/main_small_text_below_heading_margin"
+            android:layout_below="@id/part1"
+            android:lineSpacingExtra="4sp"
+            android:text="@string/camera_swap_long_text"
+            android:autoLink="web" />
+
+        <Button
+            android:id="@+id/button_remind_later"
+            style="@style/ButtonWhiteGrey"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/camera_swap_remind_me_later"
+            android:layout_above="@+id/button_got_it"
+            android:layout_marginBottom="@dimen/main_margin_small" />
+
+    </RelativeLayout>
+
+</LinearLayout>
diff --git a/app/src/main/res/layout/offline_details_fragment.xml b/app/src/main/res/layout/offline_details_fragment.xml
deleted file mode 100644
index 0d63536..0000000
--- a/app/src/main/res/layout/offline_details_fragment.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/offline_details_fragment"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-
-    <include layout="@layout/header_fragment" />
-
-    <RelativeLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="@color/background"
-        android:gravity="center_horizontal"
-        android:orientation="vertical"
-        android:padding="@dimen/main_padding">
-
-        <Button
-            android:id="@+id/button_close"
-            style="@style/ButtonWhiteBlue"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_alignParentBottom="true"
-            android:layout_centerHorizontal="true"
-            android:text="@string/camera_swap_close" />
-
-        <TextView
-            android:id="@+id/instructions"
-            style="@style/TextRegular14BlueDark"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/camera_swap_long_text"
-            android:layout_alignParentTop="true"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="10sp"
-            android:lineSpacingExtra="4sp" />
-
-        <TextView
-            android:id="@+id/url"
-            style="@style/TextRegular14BlueDark"
-            android:autoLink="web"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/camera_swap_url"
-            android:layout_below="@+id/instructions"
-            android:layout_alignStart="@+id/instructions" />
-
-        <CheckBox
-            style="@style/TextRegular14BlueDark"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:id="@+id/dont_show_again_checkbox"
-            android:checked="false"
-            android:text="@string/camera_swap_dont_show_again"
-            android:layout_above="@+id/button_close"
-            android:layout_marginBottom="5dp" />
-
-    </RelativeLayout>
-
-</LinearLayout>
diff --git a/app/src/main/res/layout/webview_fragment.xml b/app/src/main/res/layout/webview_fragment.xml
deleted file mode 100644
index b233545..0000000
--- a/app/src/main/res/layout/webview_fragment.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:id="@+id/camera_swap_webview_fragment"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-
-    <TextView
-        android:id="@+id/location_bar"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:text="@string/camera_swap_url"
-        style="@style/LocationBar" />
-
-    <WebView
-        android:id="@+id/camera_swap_webview"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"></WebView>
-
-</LinearLayout>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ad6b4fa..2ccac47 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -5,5 +5,15 @@
     <string name="camera_swap_url">https://fairphone.com/camera-swap</string>
     <string name="camera_swap_dont_show_again">Don\'t show again</string>
     <string name="camera_swap_close">Close</string>
-    <string name="camera_swap_long_text">Make sure to select the appropriate resolution for this camera module in your camera app before starting to take pictures.\n\nVisit the following article for this and more information on how to get the best out of your camera:</string>
+    <string name="camera_swap_remind_me_later">Remind me later</string>
+    <string name="camera_swap_got_it">Got it</string>
+    <string name="camera_swap_long_text">If you are using third-party camera applications, you might need to select a different resolution. Visit <a href="https://fairphone.com/camera-swap">https://fairphone.com/camera-swap</a> for more information.</string>
+    <string name="camera_swap_text_part1_main">Your main camera is now ready to be used.</string>
+    <string name="camera_swap_text_part1_front">Your front camera is now ready to be used.</string>
+    <string name="camera_swap_text_part1_both">Your main camera and front camera are now ready to be used.</string>
+    <string name="camera_swap_notification_title">Camera Module</string>
+    <string name="camera_swap_notification_summary">Camera module successfully replaced.</string>
+    <string name="camera_swap_notification_text">To make sure your new camera works optimally, please read these tips.</string>
+    <string name="camera_swap_notification_dismiss">Dismiss</string>
+    <string name="camera_swap_notification_open">Open</string>
 </resources>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 387b640..0c3d7d8 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -42,6 +42,11 @@
         <item name="android:textColor">@color/white</item>
     </style>
 
+    <style name="ButtonWhiteGrey" parent="@style/Button">
+        <item name="android:background">@drawable/button_grey_background</item>
+        <item name="android:textColor">@color/white</item>
+    </style>
+
     <!-- TEXT REGULAR -->
     <style name="TextRegular">
         <item name="android:fontFamily">sans-serif</item>