Merge "Finalize Strings and Icon for Network Logging Notification"

This commit is contained in:
Philipp Weiß
2017-03-20 12:03:03 +00:00
committed by Android (Google) Code Review
5 changed files with 35 additions and 37 deletions

View File

@@ -0,0 +1,25 @@
<!--
Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
</vector>

View File

@@ -1,29 +0,0 @@
<!--
Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- STOPSHIP: Placeholder icon for network logging until the real icon is finalized-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#4DFFFFFF" >
<path
android:fillColor="#FFFFFFFF"
android:pathData="M2,24v-4h12v4H2z M2,16v-4h20v4H2z M5,7 12,0 19,7 14,7 14,15 10,15 10,7z"/>
</vector>

View File

@@ -392,12 +392,12 @@
This indicates that a work profile has been deleted. [CHAR LIMIT=NONE]-->
<string name="work_profile_deleted_description_dpm_wipe">Your work profile is no longer available on this device.</string>
<!-- Content title for a notification. This indicates that network logging was activated by
a device owner. [CHAR LIMIT=NONE]-->
<string name="network_logging_notification_title">Network traffic is being monitored</string>
<!-- Content text for a notification. Tapping opens a dialog with more information on network
logging. [CHAR LIMIT=NONE]-->
<string name="network_logging_notification_text">Tap to learn more</string>
<!-- Content title for a notification. This notification indicates that the device is managed
and network logging was activated by a device owner. [CHAR LIMIT=NONE]-->
<string name="network_logging_notification_title">Device is managed</string>
<!-- Content text for a notification. Tapping opens a dialog with more information on device management and network
logging. [CHAR LIMIT=NONE]-->
<string name="network_logging_notification_text">Your organization manages this device and may monitor network traffic. Tap for details.</string>
<!-- Factory reset warning dialog strings--> <skip />
<!-- Shows up in the dialog's title to warn about an impeding factory reset. [CHAR LIMIT=NONE] -->

View File

@@ -1239,12 +1239,12 @@
<java-symbol type="drawable" name="ic_contact_picture" />
<java-symbol type="drawable" name="ic_dialog_usb" />
<java-symbol type="drawable" name="ic_emergency" />
<java-symbol type="drawable" name="ic_info_outline" />
<java-symbol type="drawable" name="ic_media_stop" />
<java-symbol type="drawable" name="ic_text_dot" />
<java-symbol type="drawable" name="ic_print" />
<java-symbol type="drawable" name="ic_print_error" />
<java-symbol type="drawable" name="ic_grayedout_printer" />
<java-symbol type="drawable" name="ic_qs_network_logging" />
<java-symbol type="drawable" name="jog_dial_arrow_long_left_green" />
<java-symbol type="drawable" name="jog_dial_arrow_long_right_red" />
<java-symbol type="drawable" name="jog_dial_arrow_short_left_and_right" />

View File

@@ -10800,12 +10800,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
UserHandle.CURRENT);
Notification notification =
new Notification.Builder(mContext, SystemNotificationChannels.DEVICE_ADMIN)
.setSmallIcon(R.drawable.ic_qs_network_logging)
.setSmallIcon(R.drawable.ic_info_outline)
.setContentTitle(mContext.getString(R.string.network_logging_notification_title))
.setContentText(mContext.getString(R.string.network_logging_notification_text))
.setTicker(mContext.getString(R.string.network_logging_notification_title))
.setShowWhen(true)
.setContentIntent(pendingIntent)
.setStyle(new Notification.BigTextStyle()
.bigText(mContext.getString(R.string.network_logging_notification_text)))
.build();
mInjector.getNotificationManager().notify(NETWORK_LOGGING_NOTIFICATION_ID, notification);
saveSettingsLocked(mOwners.getDeviceOwnerUserId());