Merge "Show "Android System" instead of "Shell" on notifications." into nyc-dev
am: 28baa37
* commit '28baa37a5676297b7972cfd90a07fff5f54cf19b':
Show "Android System" instead of "Shell" on notifications.
Change-Id: If1238072e38b7dd4b6b5f10a0e325edfc455cdc1
This commit is contained in:
@@ -111,6 +111,8 @@
|
|||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
<uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" />
|
<uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" />
|
||||||
<uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" />
|
<uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" />
|
||||||
|
<!-- Permission needed to rename bugreport notifications (so they're not shown as Shell) -->
|
||||||
|
<uses-permission android:name="android.permission.SUBSTITUTE_NOTIFICATION_APP_NAME" />
|
||||||
|
|
||||||
<application android:label="@string/app_label"
|
<application android:label="@string/app_label"
|
||||||
android:defaultToDeviceProtectedStorage="true"
|
android:defaultToDeviceProtectedStorage="true"
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ import android.content.Intent;
|
|||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.HandlerThread;
|
import android.os.HandlerThread;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@@ -204,6 +205,8 @@ public class BugreportProgressService extends Service {
|
|||||||
*/
|
*/
|
||||||
private boolean mTakingScreenshot;
|
private boolean mTakingScreenshot;
|
||||||
|
|
||||||
|
private static final Bundle sNotificationBundle = new Bundle();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
mContext = getApplicationContext();
|
mContext = getApplicationContext();
|
||||||
@@ -979,7 +982,13 @@ public class BugreportProgressService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Notification.Builder newBaseNotification(Context context) {
|
private static Notification.Builder newBaseNotification(Context context) {
|
||||||
|
if (sNotificationBundle.isEmpty()) {
|
||||||
|
// Rename notifcations from "Shell" to "Android System"
|
||||||
|
sNotificationBundle.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME,
|
||||||
|
context.getString(com.android.internal.R.string.android_system_label));
|
||||||
|
}
|
||||||
return new Notification.Builder(context)
|
return new Notification.Builder(context)
|
||||||
|
.addExtras(sNotificationBundle)
|
||||||
.setCategory(Notification.CATEGORY_SYSTEM)
|
.setCategory(Notification.CATEGORY_SYSTEM)
|
||||||
.setSmallIcon(com.android.internal.R.drawable.stat_sys_adb)
|
.setSmallIcon(com.android.internal.R.drawable.stat_sys_adb)
|
||||||
.setLocalOnly(true)
|
.setLocalOnly(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user