Merge "Solve NPE caused by concurrrent access to mBar" into udc-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7fadc7a50b
@@ -347,9 +347,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showScreenPinningRequest(int taskId) {
|
public void showScreenPinningRequest(int taskId) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showScreenPinningRequest(taskId);
|
bar.showScreenPinningRequest(taskId);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -357,9 +358,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showAssistDisclosure() {
|
public void showAssistDisclosure() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showAssistDisclosure();
|
bar.showAssistDisclosure();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -367,9 +369,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startAssist(Bundle args) {
|
public void startAssist(Bundle args) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.startAssist(args);
|
bar.startAssist(args);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -377,9 +380,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCameraLaunchGestureDetected(int source) {
|
public void onCameraLaunchGestureDetected(int source) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.onCameraLaunchGestureDetected(source);
|
bar.onCameraLaunchGestureDetected(source);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -393,9 +397,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void onEmergencyActionLaunchGestureDetected() {
|
public void onEmergencyActionLaunchGestureDetected() {
|
||||||
if (SPEW) Slog.d(TAG, "Launching emergency action");
|
if (SPEW) Slog.d(TAG, "Launching emergency action");
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.onEmergencyActionLaunchGestureDetected();
|
bar.onEmergencyActionLaunchGestureDetected();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
if (SPEW) Slog.d(TAG, "Failed to launch emergency action");
|
if (SPEW) Slog.d(TAG, "Failed to launch emergency action");
|
||||||
}
|
}
|
||||||
@@ -410,9 +415,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void toggleSplitScreen() {
|
public void toggleSplitScreen() {
|
||||||
enforceStatusBarService();
|
enforceStatusBarService();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.toggleSplitScreen();
|
bar.toggleSplitScreen();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -420,27 +426,30 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void appTransitionFinished(int displayId) {
|
public void appTransitionFinished(int displayId) {
|
||||||
enforceStatusBarService();
|
enforceStatusBarService();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.appTransitionFinished(displayId);
|
bar.appTransitionFinished(displayId);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toggleTaskbar() {
|
public void toggleTaskbar() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.toggleTaskbar();
|
bar.toggleTaskbar();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toggleRecentApps() {
|
public void toggleRecentApps() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.toggleRecentApps();
|
bar.toggleRecentApps();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -454,45 +463,50 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preloadRecentApps() {
|
public void preloadRecentApps() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.preloadRecentApps();
|
bar.preloadRecentApps();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancelPreloadRecentApps() {
|
public void cancelPreloadRecentApps() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.cancelPreloadRecentApps();
|
bar.cancelPreloadRecentApps();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showRecentApps(boolean triggeredFromAltTab) {
|
public void showRecentApps(boolean triggeredFromAltTab) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showRecentApps(triggeredFromAltTab);
|
bar.showRecentApps(triggeredFromAltTab);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
|
public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.hideRecentApps(triggeredFromAltTab, triggeredFromHomeKey);
|
bar.hideRecentApps(triggeredFromAltTab, triggeredFromHomeKey);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void collapsePanels() {
|
public void collapsePanels() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.animateCollapsePanels();
|
bar.animateCollapsePanels();
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -500,18 +514,20 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dismissKeyboardShortcutsMenu() {
|
public void dismissKeyboardShortcutsMenu() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.dismissKeyboardShortcutsMenu();
|
bar.dismissKeyboardShortcutsMenu();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toggleKeyboardShortcutsMenu(int deviceId) {
|
public void toggleKeyboardShortcutsMenu(int deviceId) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.toggleKeyboardShortcutsMenu(deviceId);
|
bar.toggleKeyboardShortcutsMenu(deviceId);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -539,9 +555,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showChargingAnimation(int batteryLevel) {
|
public void showChargingAnimation(int batteryLevel) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showWirelessChargingAnimation(batteryLevel);
|
bar.showWirelessChargingAnimation(batteryLevel);
|
||||||
} catch (RemoteException ex){
|
} catch (RemoteException ex){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -549,7 +566,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showPictureInPictureMenu() {
|
public void showPictureInPictureMenu() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showPictureInPictureMenu();
|
mBar.showPictureInPictureMenu();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
@@ -558,27 +576,30 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setWindowState(int displayId, int window, int state) {
|
public void setWindowState(int displayId, int window, int state) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.setWindowState(displayId, window, state);
|
bar.setWindowState(displayId, window, state);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void appTransitionPending(int displayId) {
|
public void appTransitionPending(int displayId) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.appTransitionPending(displayId);
|
bar.appTransitionPending(displayId);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void appTransitionCancelled(int displayId) {
|
public void appTransitionCancelled(int displayId) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.appTransitionCancelled(displayId);
|
bar.appTransitionCancelled(displayId);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -586,9 +607,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void appTransitionStarting(int displayId, long statusBarAnimationsStartTime,
|
public void appTransitionStarting(int displayId, long statusBarAnimationsStartTime,
|
||||||
long statusBarAnimationsDuration) {
|
long statusBarAnimationsDuration) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.appTransitionStarting(
|
bar.appTransitionStarting(
|
||||||
displayId, statusBarAnimationsStartTime, statusBarAnimationsDuration);
|
displayId, statusBarAnimationsStartTime, statusBarAnimationsDuration);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
@@ -596,9 +618,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTopAppHidesStatusBar(boolean hidesStatusBar) {
|
public void setTopAppHidesStatusBar(boolean hidesStatusBar) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.setTopAppHidesStatusBar(hidesStatusBar);
|
bar.setTopAppHidesStatusBar(hidesStatusBar);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -608,9 +631,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
if (!mContext.getResources().getBoolean(R.bool.config_showSysuiShutdown)) {
|
if (!mContext.getResources().getBoolean(R.bool.config_showSysuiShutdown)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showShutdownUi(isReboot, reason);
|
bar.showShutdownUi(isReboot, reason);
|
||||||
return true;
|
return true;
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
@@ -629,18 +653,20 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisplayReady(int displayId) {
|
public void onDisplayReady(int displayId) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.onDisplayReady(displayId);
|
bar.onDisplayReady(displayId);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecentsAnimationStateChanged(boolean running) {
|
public void onRecentsAnimationStateChanged(boolean running) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.onRecentsAnimationStateChanged(running);
|
bar.onRecentsAnimationStateChanged(running);
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -654,9 +680,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
getUiState(displayId).setBarAttributes(appearance, appearanceRegions,
|
getUiState(displayId).setBarAttributes(appearance, appearanceRegions,
|
||||||
navbarColorManagedByIme, behavior, requestedVisibleTypes, packageName,
|
navbarColorManagedByIme, behavior, requestedVisibleTypes, packageName,
|
||||||
letterboxDetails);
|
letterboxDetails);
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.onSystemBarAttributesChanged(displayId, appearance, appearanceRegions,
|
bar.onSystemBarAttributesChanged(displayId, appearance, appearanceRegions,
|
||||||
navbarColorManagedByIme, behavior, requestedVisibleTypes, packageName,
|
navbarColorManagedByIme, behavior, requestedVisibleTypes, packageName,
|
||||||
letterboxDetails);
|
letterboxDetails);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
@@ -667,9 +694,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
public void showTransient(int displayId, @InsetsType int types,
|
public void showTransient(int displayId, @InsetsType int types,
|
||||||
boolean isGestureOnSystemBar) {
|
boolean isGestureOnSystemBar) {
|
||||||
getUiState(displayId).showTransient(types);
|
getUiState(displayId).showTransient(types);
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showTransient(displayId, types, isGestureOnSystemBar);
|
bar.showTransient(displayId, types, isGestureOnSystemBar);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -677,9 +705,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void abortTransient(int displayId, @InsetsType int types) {
|
public void abortTransient(int displayId, @InsetsType int types) {
|
||||||
getUiState(displayId).clearTransient(types);
|
getUiState(displayId).clearTransient(types);
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.abortTransient(displayId, types);
|
bar.abortTransient(displayId, types);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -688,9 +717,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
public void showToast(int uid, String packageName, IBinder token, CharSequence text,
|
public void showToast(int uid, String packageName, IBinder token, CharSequence text,
|
||||||
IBinder windowToken, int duration,
|
IBinder windowToken, int duration,
|
||||||
@Nullable ITransientNotificationCallback callback, int displayId) {
|
@Nullable ITransientNotificationCallback callback, int displayId) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showToast(uid, packageName, token, text, windowToken, duration, callback,
|
bar.showToast(uid, packageName, token, text, windowToken, duration, callback,
|
||||||
displayId);
|
displayId);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
@@ -698,18 +728,20 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hideToast(String packageName, IBinder token) {
|
public void hideToast(String packageName, IBinder token) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.hideToast(packageName, token);
|
bar.hideToast(packageName, token);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean requestWindowMagnificationConnection(boolean request) {
|
public boolean requestWindowMagnificationConnection(boolean request) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.requestWindowMagnificationConnection(request);
|
bar.requestWindowMagnificationConnection(request);
|
||||||
return true;
|
return true;
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
@@ -718,9 +750,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable) {
|
public void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.setNavigationBarLumaSamplingEnabled(displayId, enable);
|
bar.setNavigationBarLumaSamplingEnabled(displayId, enable);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -730,45 +763,50 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
mUdfpsRefreshRateRequestCallback = callback;
|
mUdfpsRefreshRateRequestCallback = callback;
|
||||||
}
|
}
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.setUdfpsRefreshRateCallback(callback);
|
bar.setUdfpsRefreshRateCallback(callback);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showRearDisplayDialog(int currentBaseState) {
|
public void showRearDisplayDialog(int currentBaseState) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showRearDisplayDialog(currentBaseState);
|
bar.showRearDisplayDialog(currentBaseState);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void goToFullscreenFromSplit() {
|
public void goToFullscreenFromSplit() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.goToFullscreenFromSplit();
|
bar.goToFullscreenFromSplit();
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enterStageSplitFromRunningApp(boolean leftOrTop) {
|
public void enterStageSplitFromRunningApp(boolean leftOrTop) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.enterStageSplitFromRunningApp(leftOrTop);
|
bar.enterStageSplitFromRunningApp(leftOrTop);
|
||||||
} catch (RemoteException ex) { }
|
} catch (RemoteException ex) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showMediaOutputSwitcher(String packageName) {
|
public void showMediaOutputSwitcher(String packageName) {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showMediaOutputSwitcher(packageName);
|
bar.showMediaOutputSwitcher(packageName);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -791,9 +829,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showGlobalActions() {
|
public void showGlobalActions() {
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showGlobalActionsMenu();
|
bar.showGlobalActionsMenu();
|
||||||
} catch (RemoteException ex) {}
|
} catch (RemoteException ex) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1116,9 +1155,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
if (!state.disableEquals(net1, net2)) {
|
if (!state.disableEquals(net1, net2)) {
|
||||||
state.setDisabled(net1, net2);
|
state.setDisabled(net1, net2);
|
||||||
mHandler.post(() -> mNotificationDelegate.onSetDisabled(net1));
|
mHandler.post(() -> mNotificationDelegate.onSetDisabled(net1));
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.disable(displayId, net1, net2);
|
bar.disable(displayId, net1, net2);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1176,9 +1216,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
//Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon);
|
//Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon);
|
||||||
mIcons.put(slot, icon);
|
mIcons.put(slot, icon);
|
||||||
|
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.setIcon(slot, icon);
|
bar.setIcon(slot, icon);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1197,9 +1238,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
if (icon.visible != visibility) {
|
if (icon.visible != visibility) {
|
||||||
icon.visible = visibility;
|
icon.visible = visibility;
|
||||||
|
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.setIcon(slot, icon);
|
bar.setIcon(slot, icon);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1214,9 +1256,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
synchronized (mIcons) {
|
synchronized (mIcons) {
|
||||||
mIcons.remove(slot);
|
mIcons.remove(slot);
|
||||||
|
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.removeIcon(slot);
|
bar.removeIcon(slot);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1823,9 +1866,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void showInattentiveSleepWarning() {
|
public void showInattentiveSleepWarning() {
|
||||||
enforceStatusBarService();
|
enforceStatusBarService();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showInattentiveSleepWarning();
|
bar.showInattentiveSleepWarning();
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1834,9 +1878,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void dismissInattentiveSleepWarning(boolean animated) {
|
public void dismissInattentiveSleepWarning(boolean animated) {
|
||||||
enforceStatusBarService();
|
enforceStatusBarService();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.dismissInattentiveSleepWarning(animated);
|
bar.dismissInattentiveSleepWarning(animated);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1845,9 +1890,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void suppressAmbientDisplay(boolean suppress) {
|
public void suppressAmbientDisplay(boolean suppress) {
|
||||||
enforceStatusBarService();
|
enforceStatusBarService();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.suppressAmbientDisplay(suppress);
|
bar.suppressAmbientDisplay(suppress);
|
||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1921,9 +1967,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.requestTileServiceListeningState(componentName);
|
bar.requestTileServiceListeningState(componentName);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "requestTileServiceListeningState", e);
|
Slog.e(TAG, "requestTileServiceListeningState", e);
|
||||||
}
|
}
|
||||||
@@ -2036,9 +2083,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
CharSequence appName = r.serviceInfo.applicationInfo
|
CharSequence appName = r.serviceInfo.applicationInfo
|
||||||
.loadLabel(mContext.getPackageManager());
|
.loadLabel(mContext.getPackageManager());
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.requestAddTile(componentName, appName, label, icon, proxyCallback);
|
bar.requestAddTile(componentName, appName, label, icon, proxyCallback);
|
||||||
return;
|
return;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "requestAddTile", e);
|
Slog.e(TAG, "requestAddTile", e);
|
||||||
@@ -2060,9 +2108,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
|
|
||||||
private void cancelRequestAddTileInternal(String packageName) {
|
private void cancelRequestAddTileInternal(String packageName) {
|
||||||
clearTileAddRequest(packageName);
|
clearTileAddRequest(packageName);
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.cancelRequestAddTile(packageName);
|
bar.cancelRequestAddTile(packageName);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "requestAddTile", e);
|
Slog.e(TAG, "requestAddTile", e);
|
||||||
}
|
}
|
||||||
@@ -2191,9 +2240,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Nullable IUndoMediaTransferCallback undoCallback
|
@Nullable IUndoMediaTransferCallback undoCallback
|
||||||
) {
|
) {
|
||||||
enforceMediaContentControl();
|
enforceMediaContentControl();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.updateMediaTapToTransferSenderDisplay(displayState, routeInfo, undoCallback);
|
bar.updateMediaTapToTransferSenderDisplay(displayState, routeInfo, undoCallback);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "updateMediaTapToTransferSenderDisplay", e);
|
Slog.e(TAG, "updateMediaTapToTransferSenderDisplay", e);
|
||||||
}
|
}
|
||||||
@@ -2214,9 +2264,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Nullable Icon appIcon,
|
@Nullable Icon appIcon,
|
||||||
@Nullable CharSequence appName) {
|
@Nullable CharSequence appName) {
|
||||||
enforceMediaContentControl();
|
enforceMediaContentControl();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.updateMediaTapToTransferReceiverDisplay(
|
bar.updateMediaTapToTransferReceiverDisplay(
|
||||||
displayState, routeInfo, appIcon, appName);
|
displayState, routeInfo, appIcon, appName);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "updateMediaTapToTransferReceiverDisplay", e);
|
Slog.e(TAG, "updateMediaTapToTransferReceiverDisplay", e);
|
||||||
@@ -2240,9 +2291,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@NonNull INearbyMediaDevicesProvider provider
|
@NonNull INearbyMediaDevicesProvider provider
|
||||||
) {
|
) {
|
||||||
enforceMediaContentControl();
|
enforceMediaContentControl();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.registerNearbyMediaDevicesProvider(provider);
|
bar.registerNearbyMediaDevicesProvider(provider);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "registerNearbyMediaDevicesProvider", e);
|
Slog.e(TAG, "registerNearbyMediaDevicesProvider", e);
|
||||||
}
|
}
|
||||||
@@ -2265,9 +2317,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@NonNull INearbyMediaDevicesProvider provider
|
@NonNull INearbyMediaDevicesProvider provider
|
||||||
) {
|
) {
|
||||||
enforceMediaContentControl();
|
enforceMediaContentControl();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.unregisterNearbyMediaDevicesProvider(provider);
|
bar.unregisterNearbyMediaDevicesProvider(provider);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "unregisterNearbyMediaDevicesProvider", e);
|
Slog.e(TAG, "unregisterNearbyMediaDevicesProvider", e);
|
||||||
}
|
}
|
||||||
@@ -2278,9 +2331,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
|
|||||||
@Override
|
@Override
|
||||||
public void showRearDisplayDialog(int currentState) {
|
public void showRearDisplayDialog(int currentState) {
|
||||||
enforceControlDeviceStatePermission();
|
enforceControlDeviceStatePermission();
|
||||||
if (mBar != null) {
|
IStatusBar bar = mBar;
|
||||||
|
if (bar != null) {
|
||||||
try {
|
try {
|
||||||
mBar.showRearDisplayDialog(currentState);
|
bar.showRearDisplayDialog(currentState);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "showRearDisplayDialog", e);
|
Slog.e(TAG, "showRearDisplayDialog", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user