cmhw: Add makeDefault arg to setDisplayMode

* Already supported by the HAL and is necessary to sync state with
   the server side.

Change-Id: I65148d5464dff8dbbee374387a01bcf13a945eb1
This commit is contained in:
Steve Kondik 2015-08-20 01:52:29 -07:00 committed by Steve Kondik
parent 648c91fa92
commit ba4db5ad36
3 changed files with 8 additions and 8 deletions

View File

@ -78,7 +78,7 @@ public class CMHardwareService extends SystemService {
public DisplayMode[] getDisplayModes();
public DisplayMode getCurrentDisplayMode();
public DisplayMode getDefaultDisplayMode();
public boolean setDisplayMode(DisplayMode mode);
public boolean setDisplayMode(DisplayMode mode, boolean makeDefault);
}
private class LegacyCMHardware implements CMHardwareInterface {
@ -290,8 +290,8 @@ public class CMHardwareService extends SystemService {
return DisplayModeControl.getDefaultMode();
}
public boolean setDisplayMode(DisplayMode mode) {
return DisplayModeControl.setMode(mode, true);
public boolean setDisplayMode(DisplayMode mode, boolean makeDefault) {
return DisplayModeControl.setMode(mode, makeDefault);
}
}
@ -515,14 +515,14 @@ public class CMHardwareService extends SystemService {
}
@Override
public boolean setDisplayMode(DisplayMode mode) {
public boolean setDisplayMode(DisplayMode mode, boolean makeDefault) {
mContext.enforceCallingOrSelfPermission(
cyanogenmod.platform.Manifest.permission.HARDWARE_ABSTRACTION_ACCESS, null);
if (!isSupported(CMHardwareManager.FEATURE_DISPLAY_MODES)) {
Log.e(TAG, "Display modes are not supported");
return false;
}
return mCmHwImpl.setDisplayMode(mode);
return mCmHwImpl.setDisplayMode(mode, makeDefault);
}
};
}

View File

@ -578,9 +578,9 @@ public final class CMHardwareManager {
/**
* @return true if setting the mode was successful
*/
public boolean setDisplayMode(DisplayMode mode) {
public boolean setDisplayMode(DisplayMode mode, boolean makeDefault) {
try {
return getService().setDisplayMode(mode);
return getService().setDisplayMode(mode, makeDefault);
} catch (RemoteException e) {
}
return false;

View File

@ -46,5 +46,5 @@ interface ICMHardwareService {
DisplayMode[] getDisplayModes();
DisplayMode getCurrentDisplayMode();
DisplayMode getDefaultDisplayMode();
boolean setDisplayMode(in DisplayMode mode);
boolean setDisplayMode(in DisplayMode mode, boolean makeDefault);
}